Sublime Forum

ColorHelper 2.0.0

#101

Yes, there are are two scaling issues in 3121/3122 affecting HiDPI on Windows/Linux:

  • hit targets for links are offset
  • scrolling can causes lines of content to be occluded from view before they should be

Fixes for these will be in the next build.

4 Likes

#102

Thanks for the confirmation. Iā€™ll wait for the next release.

0 Likes

#103

Hi, with ST3123 the links are now clickable at where they appear, and no longer appear as ā€œstroke throughā€.

However, the color squares are still remarkably large (as before) no matter what value I set in ā€œmdpopups.font_scaleā€

0 Likes

#104

I will give it a try. I havenā€™t upgraded yet due to other stability issues in previous versions of Sublime dev. But again, it may still be a Sublime issue, but Iā€™ll check.

0 Likes

#105

Just an FYI, build 3123 is the last dev build before we release 3124 as a beta ā€“ baring any reports of major issues.

0 Likes

#106

@wbond, Thanks, I will try and get any bug reports in soon if discovered. I have meetings all day these next two days, so I may not get to test any of this stuff out until Friday :(.

0 Likes

#107

I see the same, and it seems to be related to what value I set in the Windows 10 display settings scaling slider (I donā€™t know what that changes under the hood). But you can see in the attached image what the color boxes look like at 100% vs what happens when scaling goes up to 150%. The larger the scaling percentage, the bigger the color boxes get.

0 Likes

#108

@wbond, one thing I 've noticed on my 4K setup is that image distortion is back; notice the how some borders are thicker than others:

With that said, I donā€™t see the large image issue, at least not on my 4K setup; Iā€™m using 125% scaling on Windows 7.

I will try out my Windows 10 machine tonight, but I am also using a scaling hack/app that letā€™s me scale things like they did in Windows 7, so Iā€™m not sure how that will turn out.

0 Likes

#109

If you are running at 125% perhaps the pixel dimensions of your images are not equaling the pixels on your screen? If you can paste the HTML, CSS and one of the images here, I can try and dig into see why it may be displayed that way.

The most recent distortion I recall was caused by the image being taller than the line-height, and the code calculating the padding to account for the line height was resulting in negative padding. This looks like a different issue.

There of course was a change when we fixed rendering all non-font CSS dimensions as device-independent pixels on Windows and Linux instead of as device pixels. This is how OS X has always done it, since the OS takes care of the scaling. This is why I am guessing it is some sort of interplay between the scale (125%) and device pixels. I would imagine that the ST codebase should handle painting your image with interpolated pixels, but that is why the CSS, HTML and image would help. Otherwise I may find working examples that are just different than the non-working code you have.

0 Likes

#110

Iā€™ll try to post a simple example later today.

0 Likes

#111

@jcberquist, As I recall, Windows 10 scales GUI stuff very different to how they used to. So much so that I found it very annoying. Some apps had blurry graphics that werenā€™t blurry in Windows 7 (I think they double the size of graphics similar to Apple retina, but I found many apps incompatible with these changes). The more I think about this, the more Iā€™m fairly certain this issue is most likely Windows 10 specific. When I verify on my Windows 10 machine, I will probably also disable my scaling hack/app that reverts things to the Windows 7 way to be sure.

0 Likes

#112

Unfortunately, I missed reporting before STā€™s next beta, but I am very much convinced that ST has introduced new image sizing issues (not like the one that was just fixed, but like previous issues before that). Looks to be stretching images in the X and/or Y directions. Hopefully I will get around to posting a stripped down example tonight.

Still havenā€™t had a chance to test out scaling on Windows 10, but hopefully tonight as well, been a busy week for me.

0 Likes

#113

I do have an answer now for why we are getting larger than normal images in ColorHelper.

  1. The reason the scale factor in mdpopups isnā€™t working is because 1) images where never affected by the font scale. Images are sized based on line height. The reason why fonts are arenā€™t affected by recently by scale height is because mdpopups had implemented its own relative fonts, but in recent builds, Sublime provided its own relative font units. So in the latest builds, mdpoups uses Sublimeā€™s relative font implementation by default instead of our cobbled together hack. You would have to change the default CSS to take advantage of the old font scale hack, but this is not recommended as the Sublime implementation is better and is the recommended way. So in short, I incorrectly recommended changing the font scale for recent builds. I simply forgot about these changes.

  2. Images are large because Sublime is now reporting line heights as 2X bigger in Windows 10 (have not tried Linux) than other OSā€™s (this is only in the very latest Sublime builds that added hi def support for Windows and Linux).

So I need to now detect Windows 10 systems with hi def screens. Python isnā€™t quite reporting a helpful windows version, but I am sure I should be able to figure out detection of Windows 10 systems from Windows 8 systems soon.

What is more difficult is telling when Sublime is being used on a 4k system. @wbond, @jps can we please get an API check that mentions when Sublime is in hidpi mode?

In the short term, I will work on detecting Windows 10 systems and provide a setting that can be toggled in either mdpoups or the plugin of interest (Iā€™ll have to see where it makes sense ā€“ mabye Iā€™ll provide a function in mdpopups that gives a useful line height) so we can calculate image height properly.

0 Likes

#114

@wbond image distortion so far seems specific to Windows 7 (on my 4K screen - havent tested on non-4K) for me. It sees to be fine on Windows 10.

0 Likes

#115

Are you referring to View.line_height()? If so, I will get that fixed. It should always return device-independent pixels (DIP), such as how CSS in minihtml deals with DIP instead of device pixels.

Without knowing more info about why, my general answer would be that this sounds like a bad idea. Sublime Text should deal with all of the scaling and resolution issues itself, and exposing this sort of thing I think it likely to result in hacks that we have to try and work around. It is certainly possible there are completely valid reasons to know this ā€“ so please tell me!

0 Likes

#116

Ok, Iā€™ll look into getting my Windows 7 VM to run at HiDPI and check it out.

0 Likes

#117

I wanted to know when we where in hidpi mode so I could divide line_height by 2, but sense this will be addressed, this is no longer needed. I wasnā€™t sure if this would be addressed directly or not. Thanks for looking into this!

0 Likes

#118

ColorHelper 2.2.0

Released Nov 5, 2016

  • New: Add support for stTheme and search cdata #59.
  • NEW: Workaround for Windows 10 HiDpi large image issue #61.
    See document for more info.
  • NEW: Added toggle support for left/right positioned previews #65.
    See document for more info.
  • FIX: Web Color insertion bug #62.
  • FIX: Preview duplication bug (hopefully ā€“ please report if not fixed) #57.
5 Likes

#119

:heart: thank you, I love this one!
And, by the way, I immediately set it to ā€œrightā€ :wink:

0 Likes

#120

Youā€™re welcome :slightly_smiling:.

0 Likes