Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CodeView's scrollable area #4448

Merged
merged 3 commits into from
Sep 9, 2022

Conversation

bkonyi
Copy link
Contributor

@bkonyi bkonyi commented Sep 7, 2022

Currently, the CodeView's scrollable area is only as wide as the longest line in the currently selected script, resulting in arguably unexpected behavior when trying to scroll while hovering over the right side of the code area.

This change makes each line in the CodeView take up the maximum amount of horizontal space possible, making the scrollable area consist of the entire code viewport.

Currently, the `CodeView`'s scrollable area is only as wide as the
longest line in the currently selected script, resulting in arguably
unexpected behavior when trying to scroll while hovering over the right
side of the code area.

This change makes each line in the `CodeView` take up the maximum amount
of horizontal space possible, making the scrollable area consist of the
entire code viewport.
@@ -376,7 +372,7 @@ class _CodeViewState extends State<CodeView>
controller: horizontalController,
child: SizedBox(
height: constraints.maxHeight,
width: fileWidth,
width: constraints.maxWidth,
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be the max of fileWidth and constraints.maxWidth so that we cover both the case where the file is wider than the view and more narrow than the view

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, that makes more sense.

@bkonyi bkonyi merged commit 9b81849 into flutter:master Sep 9, 2022
@bkonyi bkonyi deleted the fix_codeview_scroll_region branch September 9, 2022 14:42
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