Refactors the Editor's scrolling implementation to be pixel-based instead of line-based. This provides smoother and more granular scrolling, which works more consistently across different input devices (like trackpads).
- The `Action::Scroll` variant now takes `pixels: f32`.
- The `Editor` now processes scroll actions using pixel values directly.
- Examples have been updated to reflect the new scrolling behavior.
* Variable font support
Here's a pretty naïve solution for variable fonts.
The iterator doesn't use the match keys' weight, but instead tries to
get the requested ideal weight, if the font is variable, otherwise it is
ignored and the actual (non-variable) weight is used. This is because I
didn't implement finding variable weight support for match keys; doing
so would be impossible without parsing TTF files when matching and I
didn't want to add that potentially expensive infrastructure if not
entirely necessary.
This is a breaking change, and I'm open for ideas on how to fix that
if it's an issue.
* cargo fmt
* Add variable font example to rich-text example
Swap color channels
Remove unused code in rich-text-winit example
Port editor example to winit
WIP
Implement scroll logic + add shape_as_needed
Handle text input using named keys
request redraw on click
cargo fmt
Implement dragging
Refactor winit event handlers to avoid duplication
Re-enable text size keyboard shortcuts
Remove unused imports
Fix updating scale factor
Fix unused variable warnings
Remove logging
Remove commented code
Delete rich-text-winit example
Rename editor-winit example to editor
- Scroll is identified by line index and layout index, instead of just
layout index
- Shaping has the option to prune, where caches outside of the scroll
view are cleared
- Syntax editor no longer requires layout of all lines, only of lines
inside scroll
- BufferLine has a metadata field that can be used by other abstractions
to know when text was changed