+
Skip to content

Conversation

RndUsr123
Copy link
Contributor

I'm running a rustup-less rust install on Windows, so I don't have clippy nor fmt and can't run the .sh script.
It's very little code and I manually tested this, so hopefully that's ok...

Let me know if the comment in state.rs needs to be updated or the text_offset name isn't clear enough.

Copy link

github-actions bot commented Aug 8, 2025

Preview available at https://egui-pr-preview.github.io/pr/7436-alignfix
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

Copy link
Collaborator

@lucasmerlin lucasmerlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Just for the record, here is a video of the bug and fix:

Screen.Recording.2025-08-08.at.14.24.12.mov
Screen.Recording.2025-08-08.at.14.25.07.mov

};

let mut offset_x = state.singleline_offset;
let mut offset_x = state.text_offset[0];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let mut offset_x = state.text_offset[0];
let mut offset_x = state.text_offset.x;

A bit more idiomatic

@lucasmerlin lucasmerlin added bug Something is broken egui labels Aug 8, 2025
Comment on lines 52 to 53
// Visual offset when editing singleline text bigger than the width.
#[cfg_attr(feature = "serde", serde(skip))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah it'd be nice if you could update the comment

Comment on lines 655 to 656
let align_offset_x = rect.left() - galley_pos.x;
let align_offset_y = rect.top() - galley_pos.y;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let align_offset_x = rect.left() - galley_pos.x;
let align_offset_y = rect.top() - galley_pos.y;
let align_offset = rect.left_top() - galley_pos;

@emilk emilk merged commit 68d456a into emilk:main Aug 12, 2025
26 checks passed
@RndUsr123 RndUsr123 deleted the align_fix branch August 13, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken egui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong sense area for a TextEdit using vertical_align

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载