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

Height calculation is off? #192

Closed
lee-dohm opened this issue Jan 6, 2015 · 14 comments
Closed

Height calculation is off? #192

lee-dohm opened this issue Jan 6, 2015 · 14 comments

Comments

@lee-dohm
Copy link

lee-dohm commented Jan 6, 2015

Atom v0.167.0-a9c0553 on Mac OS X 10.10.1 using 27" Retina iMac

I also have *.editor.scrollPastEnd enabled.

Apologies in advance for the huge image:

minimap-height

@lee-dohm
Copy link
Author

lee-dohm commented Jan 6, 2015

I have the following in my styles.less:

@ui-font-size: 14px;

atom-workspace {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: @ui-font-size;
}

I suspect that with the change in how the minimap is attached to the editor view, this style may now affect the size of the minimap text (which does appear larger) and is therefore throwing off the size calculations.

@abe33
Copy link
Contributor

abe33 commented Jan 6, 2015

It shouldn't, minimap is now canvas based, and so is unaffected by font styles. By the look of it it's like the previous version stretching bug on resize window. Have you enabled the v4 preview setting and restarted?

@abe33
Copy link
Contributor

abe33 commented Jan 6, 2015

Oh... looks like something retina-related. Sadly I haven't a retina display available for testing, however the code for drawing on the canvas is roughly the same as before. I'll try to find a computer with a retina screen to test that.

@abe33
Copy link
Contributor

abe33 commented Jan 6, 2015

Can you tell me what is the size of the canvas inside the atom-text-editor-minimap element in that situation?

@lee-dohm
Copy link
Author

lee-dohm commented Jan 6, 2015

Sure ... looks like 200x1832

screen shot 2015-01-06 at 6 25 52 am

@abe33
Copy link
Contributor

abe33 commented Jan 6, 2015

Ok, it should be a quick fix, the canvas must have a style.width and style.height in addition of width and height attributes.

@lee-dohm
Copy link
Author

lee-dohm commented Jan 6, 2015

🍻 Thanks for your help!

@abe33
Copy link
Contributor

abe33 commented Jan 6, 2015

If you have some time to try a thing, does the canvas get the correct scale if you specify a width/height in its style attributes with values of half the canvas size?

@lee-dohm
Copy link
Author

lee-dohm commented Jan 6, 2015

When I try to override it like you say, it doesn't change anything and I get warning icons in the style viewer:

screen shot 2015-01-06 at 7 58 56 am

@abe33
Copy link
Contributor

abe33 commented Jan 6, 2015

You should use px unit for the width and height in the style attribute ;)

@lee-dohm
Copy link
Author

lee-dohm commented Jan 6, 2015

😊

Yeah, that works.

I always say that CSS isn't my thing! 😆

@abe33
Copy link
Contributor

abe33 commented Jan 6, 2015

Yeah, that works.

The change of size to fix the scaling issue or the use of px for width & height?

@lee-dohm
Copy link
Author

lee-dohm commented Jan 6, 2015

Both 😀

On Jan 6, 2015, at 9:18 AM, Cédric Néhémie notifications@github.com wrote:

Yeah, that works.

The change of size to fix the scaling issue or the use of px for width & height?


Reply to this email directly or view it on GitHub.

@abe33 abe33 closed this as completed in 8c066ee Jan 6, 2015
@lee-dohm
Copy link
Author

lee-dohm commented Jan 7, 2015

Thanks! Confirmed on my machine 👍

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

No branches or pull requests

2 participants