@@ -750,7 +750,7 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) {
750750 }
751751 }
752752 }
753- rect .left += INSET - 1 ;
753+ rect .left += Win32DPIUtils . pointToPixel ( INSET - 1 , zoom ) ;
754754 if (drawImage ) {
755755 Image image = null ;
756756 if (index == 0 ) {
@@ -759,8 +759,8 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) {
759759 Image [] images = item .images ;
760760 if (images != null ) image = images [index ];
761761 }
762- int inset = i != 0 ? INSET : 0 ;
763- int offset = i != 0 ? INSET : INSET + 2 ;
762+ int inset = i != 0 ? Win32DPIUtils . pointToPixel ( INSET , zoom ) : 0 ;
763+ int offset = i != 0 ? Win32DPIUtils . pointToPixel ( INSET , zoom ) : Win32DPIUtils . pointToPixel ( INSET + 2 , zoom ) ;
764764 if (image != null ) {
765765 Rectangle bounds = image .getBounds (); // Points
766766 if (size == null ) size = Win32DPIUtils .pixelToPoint (getImageSize (), zoom ); // To Points
@@ -5488,7 +5488,7 @@ public void showColumn (TreeColumn column) {
54885488 SCROLLINFO info = new SCROLLINFO ();
54895489 info .cbSize = SCROLLINFO .sizeof ;
54905490 info .fMask = OS .SIF_POS ;
5491- info .nPos = Math .max (0 , headerRect .left - Tree . INSET / 2 );
5491+ info .nPos = Math .max (0 , headerRect .left - Win32DPIUtils . pointToPixel ( INSET / 2 , getZoom ()) );
54925492 OS .SetScrollInfo (hwndParent , OS .SB_HORZ , info , true );
54935493 setScrollWidth ();
54945494 } else if (scrollBecauseRight ) {
@@ -5502,8 +5502,8 @@ public void showColumn (TreeColumn column) {
55025502 // info.nPos + wideRect = headerRect.left + wideHeader
55035503 // info.nPos = headerRect.left + wideHeader - wideRect
55045504 info .nPos = Math .max (0 , wideHeader + headerRect .left - wideRect
5505- - Tree . INSET / 2 );
5506- info .nPos = Math .min (rect .right - Tree . INSET / 2 , info .nPos );
5505+ - Win32DPIUtils . pointToPixel ( INSET / 2 , getZoom ()) );
5506+ info .nPos = Math .min (rect .right - Win32DPIUtils . pointToPixel ( INSET / 2 , getZoom ()) , info .nPos );
55075507
55085508 OS .SetScrollInfo (hwndParent , OS .SB_HORZ , info , true );
55095509 setScrollWidth ();
@@ -7930,7 +7930,7 @@ LRESULT wmNotifyHeader (NMHDR hdr, long wParam, long lParam) {
79307930 }
79317931 }
79327932
7933- int x = rects [i ].left + INSET + 2 ;
7933+ int x = rects [i ].left + Win32DPIUtils . pointToPixel ( INSET + 2 , getZoom ()) ;
79347934 if (columns [i ].image != null ) {
79357935 GCData data = new GCData ();
79367936 data .device = display ;
@@ -8248,7 +8248,7 @@ LRESULT wmNotifyToolTip (NMTTCUSTOMDRAW nmcd, long lParam) {
82488248 data .background = OS .GetBkColor (nmcd .hdc );
82498249 data .font = Font .win32_new (display , hFont );
82508250 GC gc = createNewGC (nmcd .hdc , data );
8251- int x = cellRect [0 ].left + INSET ;
8251+ int x = cellRect [0 ].left + Win32DPIUtils . pointToPixel ( INSET , getZoom ()) ;
82528252 if (index [0 ] != 0 ) x -= gridWidth ;
82538253 Image image = item [0 ].getImage (index [0 ]);
82548254 if (image != null || index [0 ] == 0 ) {
@@ -8259,11 +8259,11 @@ LRESULT wmNotifyToolTip (NMTTCUSTOMDRAW nmcd, long lParam) {
82598259 Rectangle rect = image .getBounds (); // Points
82608260 int zoom = getZoom ();
82618261 gc .drawImage (image , rect .x , rect .y , rect .width , rect .height , DPIUtil .pixelToPoint (x , zoom ), DPIUtil .pixelToPoint (imageRect .top , zoom ), DPIUtil .pixelToPoint (size .x , zoom ), DPIUtil .pixelToPoint (size .y , zoom ));
8262- x += INSET + (index [0 ] == 0 ? 1 : 0 );
8262+ x += Win32DPIUtils . pointToPixel ( INSET , getZoom ()) + (index [0 ] == 0 ? 1 : 0 );
82638263 }
82648264 x += size .x ;
82658265 } else {
8266- x += INSET ;
8266+ x += Win32DPIUtils . pointToPixel ( INSET , getZoom ()) ;
82678267 }
82688268 String string = item [0 ].getText (index [0 ]);
82698269 if (string != null ) {
0 commit comments