Skip to content

Feature: fit modes for pen inputs. - #9

Open
Endermanbugzjfc wants to merge 10 commits into
alvesvaren:mainfrom
Endermanbugzjfc:Endermanbugzjfc-fit-modes
Open

Endermanbugzjfc wants to merge 10 commits into
alvesvaren:mainfrom
Endermanbugzjfc:Endermanbugzjfc-fit-modes

Conversation

@Endermanbugzjfc

@Endermanbugzjfc Endermanbugzjfc commented Jul 25, 2026 •

Copy link
Copy Markdown

Background

This pull request adds 2 extra fit modes to transform pen inputs.

Currently, pen paths on the 4:3 screen of reMarkable 2 are stretched to fill the 16:9 monitors. This might create annoyance for users' muscle memory for those who worked on a common drawing tablet with a 16:9 screen.

Changes

  • A fit option has been added, which corresponds to the --fit CLI argument and the fit field in the config file. The default value is set to "fill" for backward compatibility. It may be set to "fill", "contain", or "cover", or some aliases of those 3 (see --help).

  • An aspect_ratio option has been added, which corresponds to the --aspect-ratio CLI argument and the aspect_ratio field in the config file. It is required for contain or cover fit modes to work.

  • A resolution option has been added, which corresponds to the --resolution CLI argument and the resolution field in the config file. It cannot coexist with aspect_ratio and is handled similarly to aspect_ratio under the hood but has a different label in the log entries.

The following illustration should give a better explanation of the different fit modes (only three of these are implemented):
image

Live tests

Live tests are done on the following environments:

CPU Architecture: x86_64
OS: Arch Linux
Desktop Environment:

  • Hyprland 0.56.0 (two monitors)
  • KDE Plasma 6.7.3 (Wayland; two monitors, only the focused one)

reMarkable: reMarkable 2 version 3.27.1.0

Potentially useful features roadmap

  • A screen_size option that overrides screen when the detection of monitors fails or is yielding inaccurate data.

Ezjfc and others added 2 commits July 25, 2026 05:10
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Endermanbugzjfc
Endermanbugzjfc force-pushed the Endermanbugzjfc-fit-modes branch from d37af60 to 76ba0b5 Compare July 25, 2026 07:01
@Endermanbugzjfc Endermanbugzjfc changed the title Feature: fit modes. Feature: fit modes for pen inputs. Jul 25, 2026
Ezjfc and others added 2 commits July 25, 2026 17:13
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Endermanbugzjfc
Endermanbugzjfc marked this pull request as ready for review July 28, 2026 02:20
@alvesvaren

Copy link
Copy Markdown
Owner

Nice! I will take a look at this later, thanks :)

@Endermanbugzjfc

Copy link
Copy Markdown
Author

I have been using the cover mode for a couple of days and it fits my workflow well.

@Endermanbugzjfc
Endermanbugzjfc marked this pull request as draft August 29, 2026 21:37
Carry the --screen option from the multiscreen branch, but accept a list
(repeatable flag / TOML array) merged into Vec<String>. fit::resolve now
filters displays to the selected screens and fits against their combined
bounding box instead of the whole desktop.

A non-fill fit requires at least one --screen (validated). Also brings the
screens subcommand and display lookup helpers over for usability.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkMvA5dqyHssFDxHyV3k2i
@Endermanbugzjfc

Endermanbugzjfc commented Aug 29, 2026 •

Copy link
Copy Markdown
Author

Update to PR: screen options are now required for all fit modes except "fill". This will be marked ready again once completing a live test on KDE Plasma.

@Endermanbugzjfc

Endermanbugzjfc commented Aug 29, 2026 •

Copy link
Copy Markdown
Author

Might be a good idea if we just use an aspect_ratio option. I suspect that the actual length does not matter for this dimension mapping.

@Endermanbugzjfc

Copy link
Copy Markdown
Author

After testing on KDE Plasma, I believe that the dependency on display-info crate data should be dropped due to its questionable accuracy. Fit modes should accept direct dimension values from the user.

Ezjfc and others added 5 commits September 6, 2026 23:54
- Update stale --fit help referencing the removed --screen flag
- Document the --aspect-ratio/--resolution flags with format examples
- Reject both aspect_ratio and resolution set together via file config
- Drop redundant closures and fix a panic-message typo

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF7dojvwM3LXJLhVHGj83D
`#[serde(try_from = "&str")]` only works with deserializers that can
lend borrowed strings; toml (and json) produce owned ones, so any file
config setting aspect_ratio or resolution failed with "expected a
borrowed string". Switch to `try_from = "String"` with a delegating
TryFrom<String> impl and add a regression test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CyyyCxzgE5RzEiy22EkG4u
@Endermanbugzjfc
Endermanbugzjfc marked this pull request as ready for review September 14, 2026 02:17
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.

3 participants