@@ -522,15 +522,14 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) {
522522 if (images != null ) image = images [index ];
523523 }
524524 if (image != null ) {
525- Rectangle bounds = image .getBounds (); // Points
526525 if (size == null ) size = Win32DPIUtils .pixelToPointAsSize (getImageSize (), zoom ); // To Points
527526 if (!ignoreDrawForeground ) {
528527 GCData data = new GCData ();
529528 data .device = display ;
530529 GC gc = createNewGC (hDC , data );
531530 RECT iconRect = item .getBounds (index , false , true , false , false , true , hDC ); // Pixels
532531 gc .setClipping (Win32DPIUtils .pixelToPoint (new Rectangle (iconRect .left , iconRect .top , iconRect .right - iconRect .left , iconRect .bottom - iconRect .top ), zoom ));
533- gc .drawImage (image , 0 , 0 , bounds . width , bounds . height , DPIUtil .pixelToPoint (iconRect .left , zoom ), DPIUtil .pixelToPoint (iconRect .top , zoom ), size .x , size .y );
532+ gc .drawImage (image , DPIUtil .pixelToPoint (iconRect .left , zoom ), DPIUtil .pixelToPoint (iconRect .top , zoom ), size .x , size .y );
534533 OS .SelectClipRgn (hDC , 0 );
535534 gc .dispose ();
536535 }
@@ -760,7 +759,6 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) {
760759 int inset = i != 0 ? INSET : 0 ;
761760 int offset = i != 0 ? INSET : INSET + 2 ;
762761 if (image != null ) {
763- Rectangle bounds = image .getBounds (); // Points
764762 if (size == null ) size = Win32DPIUtils .pixelToPointAsSize (getImageSize (), zoom ); // To Points
765763 if (!ignoreDrawForeground ) {
766764 //int y1 = rect.top + (index == 0 ? (getItemHeight () - size.y) / 2 : 0);
@@ -770,7 +768,7 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) {
770768 data .device = display ;
771769 GC gc = createNewGC (hDC , data );
772770 gc .setClipping (Win32DPIUtils .pixelToPoint (new Rectangle (x1 , rect .top , rect .right - x1 , rect .bottom - rect .top ), zoom ));
773- gc .drawImage (image , 0 , 0 , bounds . width , bounds . height , DPIUtil .pixelToPoint (x1 , zoom ), DPIUtil .pixelToPoint (y1 , zoom ), size .x , size .y );
771+ gc .drawImage (image , DPIUtil .pixelToPoint (x1 , zoom ), DPIUtil .pixelToPoint (y1 , zoom ), size .x , size .y );
774772 OS .SelectClipRgn (hDC , 0 );
775773 gc .dispose ();
776774 }
@@ -8256,9 +8254,8 @@ LRESULT wmNotifyToolTip (NMTTCUSTOMDRAW nmcd, long lParam) {
82568254 RECT imageRect = item [0 ].getBounds (index [0 ], false , true , false , false , false , hDC );
82578255 if (imageList == null ) size .x = imageRect .right - imageRect .left ;
82588256 if (image != null ) {
8259- Rectangle rect = image .getBounds (); // Points
82608257 int zoom = getZoom ();
8261- 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 ));
8258+ gc .drawImage (image , DPIUtil .pixelToPoint (x , zoom ), DPIUtil .pixelToPoint (imageRect .top , zoom ), DPIUtil .pixelToPoint (size .x , zoom ), DPIUtil .pixelToPoint (size .y , zoom ));
82628259 x += INSET + (index [0 ] == 0 ? 1 : 0 );
82638260 }
82648261 x += size .x ;
0 commit comments