Re: Dark styles bounded by unexpected white lines

John Ehresman <[email protected]> Mon, 3 Feb 2025 17:30:02 +1300
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
It’s been some time since I worked with Qt’s HIDPI support, but I don’t think there’s a way to work purely in the screen pixel dimensions like I think you can in the win32 api. What you can do is render into a pixmap at the higher resolution and then paint that pixmap to the screen. 

Qt implements HIDPI support through the device pixel ratio, which is the ratio of device independent coordinates to device pixels. On macOS this is typically 2.0, meaning a 200x200 device independent square renders as a 400x400 pixel square on the screen. Taking a 200x200 device independent square as an example — to draw at the higher 400x400 resolution, create a 400x400 QPixmap, set the devicePixelRatio to 1.0 and draw. Then to render to the screen, set the devicePixelRatio to 2.0 and paint the pixmap to the screen. This is what we’ve done to render high dpi icons.

I’m willing to do some experiments to try to render lines and other elements at HIDPI, but it’s been some time since I’ve worked with the core drawing code so would appreciate some pointers. Also is there a test case that shows the problem, preferably on macOS?

Thanks,

John

> On Jan 11, 2025, at 10:43 AM, Neil <[email protected]> wrote:
> 
> As mentioned on some of the issues, exposing Scintilla to the true pixel dimensions should allow this to be solved. There are likely Qt APIs to specify that the calling code is High-DPI aware and to retrieve scaling information.
> 
> If that is not possible, an overdraw technique could be tried. That would draw at least an extra logical pixel (as seen by Scintilla) at the bottom of each line. This should ensure the bottom physical pixel is completely painted but may also tint the following pixel. Drawing the next line may mix (blur) with the boundary pixel and completely paints the next pixel. Since it is drawing with the current colours (not a single global colour) this should adapt to situations where there are segments of the document with different background colours. It would only work for SC_PHASES_MULTIPLE and unbuffered drawing as other modes clip drawing to the line in logical pixels.
> 
> A scale below 100% may still cause problems as the next physical pixel may not be covered by a single logical pixel.
> 
> Drawing pixels twice will be less efficient and this addition would also increase the complexity of the drawing code.
> 
> Within each line, segment background drawing could also add an extra pixel to the right and that would work (just for the short vertical lines shown) even in SC_PHASES_TWO.
> 
> Neil
> 
> -- 
> You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/bd785523-13d2-4356-8e36-7b21322c073dn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/D5262E23-130C-433D-92FF-2368A1A8D876%40wingware.com.