-
Notifications
You must be signed in to change notification settings - Fork 55
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
iOS: Gutter shifted up from the text #261
Comments
Good afternoon @alexeyinkin, If you set up the same font, size and line height for the code and the gutter, the problem disappears. Cheers, |
Hi, I have try to set the same fontsize in the theme (custom one) and the gutter, but it does not solve the problem. Any idea ? |
Have you tried modifying the line height? The two properties I had to modify were "fontSize" and "height" besides, of course, making sure the font family was the same for both. Hope it helps, Cheers, |
Perhaps I’m wrong but, from your picture, I don’t think the font family and
effects are the same. It looks like the text in the code are is bold
whereas in the gutter is not. Are you sure they are configured the same way?
For my experience with this issue and the code I’ve reviewed from the
code-editor component doesn’t seem to show any synchronization between
gutter and code other than font properties.
I don’t have the code at hand right now but I created a text style defining
the complete format and reuse it for both, the code editor and the gutter
resulting in a perfect synchronization. I remember I picked a monospace
font from the Google font library.
If these comments don’t help, let me know and I’ll try to find the changes
I did and post an example.
Cheers,
Antonio Jesús
…On Thu, 4 Jan 2024 at 11:35, Clubber Lang ***@***.***> wrote:
Playing with 'height' helps a little bit... I have less offset, but it
does not solve.
I still have some offsets..
Please, look at the picture, I have add some "red line" to show you:
image.png (view on web)
<https://github.com/akvelon/flutter-code-editor/assets/17200971/2e2c86d6-2563-4cfd-a230-95feddf32502>
—
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKX5LBUG3HCVXRIPOWK2H63YM2AWNAVCNFSM6AAAAAA7CNLU5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZWHA3DSMJSG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Setting the height on both textStyle and gutterStyle did seem to fix the desync for me, unsure whether it will work on other fonts or not. CodeField(
controller: controller,
textStyle: GoogleFonts.jetBrainsMono(
fontSize: 14,
height: 1.4,
),
gutterStyle: GutterStyle(
textStyle: GoogleFonts.jetBrainsMono(
fontSize: 14,
height: 1.4,
),
),
) |
Note: This issue is about just shifting. Line heights match and do not de-sync further down the gutter. For an issue with Material 3 with progressively shifting numbers, see #262
Run the example 02.code_field unmodified, as of 0f18b2b.
Web -- Gutter is aligned with the code lines:
iOS -- Gutter is shifted upwards for ~20% of the line height:
This is likely due to an issue in Flutter since there is nothing platform-specific in the editor, and it is built of standard widgets.
flutter doctor -v
The text was updated successfully, but these errors were encountered: