Commit 6425e28
committed
[GTK] Consider transformation scale in GC.drawImage(image, x, y) #2919
With e97143c, support was added on
Windows to take the `Transform` scaling into consideration when calling
`drawImage(image,x,y)`. Especially when used in combination with an
SVG-based image, this leads to better results as the best-fitting image
is used for painting, rather than relying on interpolation.
This change follows a similar logic to what has been done for Windows;
The call to `drawImage(image,x,y)` is delegated to `drawImage(x,y,w,h)`
when a `Transform` has been set. Within this method, the width and
height of the image are used as size after being multiplied by the
transformation scale.
Contributes to
#29191 parent f1bf0d3 commit 6425e28
File tree
2 files changed
+25
-4
lines changed- bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics
- tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit
2 files changed
+25
-4
lines changedLines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
193 | 205 | | |
194 | 206 | | |
195 | 207 | | |
| |||
791 | 803 | | |
792 | 804 | | |
793 | 805 | | |
794 | | - | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
795 | 812 | | |
796 | 813 | | |
797 | 814 | | |
| |||
886 | 903 | | |
887 | 904 | | |
888 | 905 | | |
889 | | - | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
890 | 910 | | |
891 | 911 | | |
892 | 912 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
| 405 | + | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| 434 | + | |
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
| |||
0 commit comments