Skip to content

Feature: tilt correction for pen offset. - #11

Open
Endermanbugzjfc wants to merge 2 commits into
alvesvaren:mainfrom
Endermanbugzjfc:Endermanbugzjfc-tilt-correction
Open

Endermanbugzjfc wants to merge 2 commits into
alvesvaren:mainfrom
Endermanbugzjfc:Endermanbugzjfc-tilt-correction

Conversation

@Endermanbugzjfc

@Endermanbugzjfc Endermanbugzjfc commented Aug 29, 2026 •

Copy link
Copy Markdown

Background

This pull request adds 2 methods to correct the pen position based on its tiling angle and height.

Currently, pen positions always assume the pen is held orthogonally to the screen, which is rarely the case, hence offsetting a little when the pen tip moves from mid-air to touching the screen.

Changes

  • A tilt_correction option has been added, which corresponds to the --tilt-correction CLI argument and the tilt_correction field in the config file. The default value is set to "off" for backward compatibility. It may be set to "off", "tilt", or "tilt-distance". "tilt" performs the correction based on the tilting angle, while "tilt-distance" is based on both the tilting angle and the height between the screen and the electrical coil in the stylus.
  • A tilt_correction_gain option has been added, which corresponds to the --tilt-correction-gain CLI argument and the tilt_correction_gain field in the config file. The default value is set to 1.0. It is a float coefficient multiplied by the base tilt-correction value. This option should represent the strength of the tilt correction.

Note: I have never used a real drawing tablet, but based on the information Claude provided, it seems most drawing tablets correct only based on the tilt angle and ignore the height parameter.

Live tests

Live tests are done on the following environments:

CPU Architecture: x86_64
OS: Arch Linux
Desktop Environment:

  • Hyprland 0.56.0

reMarkable: reMarkable 2 version 3.27.3.0

Cancel the tilt-induced offset between the hover cursor (the digitizer's
resonant-coil projection) and the pen-down nib. Adds a `tilt_correction`
mode (off/tilt/tilt-distance) plus a `tilt_correction_gain` strength,
exposed via CLI and config file. Defaults to off for backward compat.

The correction runs in raw device space before orientation (and any
downstream aspect-ratio warp), computing gain*sin(tilt) per axis, with
the tilt-distance mode ramping it off by hover proximity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread rm-pad.toml.example Resolved
Comment thread README.md Resolved
Comment thread src/config/mod.rs Resolved
…ibility

Co-authored-by: EndermanbugZJFC <53002741+Endermanbugzjfc@users.noreply.github.com>
@Endermanbugzjfc
Endermanbugzjfc marked this pull request as ready for review September 5, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants