Skip to content

Commit fb51e54

Browse files
arunjose696akoch-yatta
authored andcommitted
Adapt usages in SWT to new GC#drawImage API
The previous drawImage method required specifying the full source and destination rectangles, which meant the caller needed to know the image size up front. This change replaces the old API call in CLabel with the newer, simplified drawImage overload that takes fewer parameters and no longer requires the caller to provide the image dimensions.
1 parent 64c6ecd commit fb51e54

File tree

1 file changed

+1
-2
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom

1 file changed

+1
-2
lines changed

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,7 @@ void onPaint(PaintEvent event) {
574574

575575
// draw the image
576576
if (img != null) {
577-
gc.drawImage(img, 0, 0, imageRect.width, imageHeight,
578-
x, imageY, imageRect.width, imageHeight);
577+
gc.drawImage(img, x, imageY, imageRect.width, imageHeight);
579578
x += imageRect.width + GAP;
580579
extent.x -= imageRect.width + GAP;
581580
}

0 commit comments

Comments
 (0)