|
Lines 446-453
Link Here
|
| 446 |
* </ul> |
446 |
* </ul> |
| 447 |
*/ |
447 |
*/ |
| 448 |
public void copyArea (Image image, int x, int y) { |
448 |
public void copyArea (Image image, int x, int y) { |
| 449 |
x = DPIUtil.autoScaleUp(drawable, x); |
449 |
x = DPIUtil.autoScaleUp(this.device, drawable, x); |
| 450 |
y = DPIUtil.autoScaleUp(drawable, y); |
450 |
y = DPIUtil.autoScaleUp(this.device, drawable, y); |
| 451 |
copyAreaInPixels(image, x, y); |
451 |
copyAreaInPixels(image, x, y); |
| 452 |
} |
452 |
} |
| 453 |
|
453 |
|
|
Lines 502-513
Link Here
|
| 502 |
* @since 3.1 |
502 |
* @since 3.1 |
| 503 |
*/ |
503 |
*/ |
| 504 |
public void copyArea (int srcX, int srcY, int width, int height, int destX, int destY, boolean paint) { |
504 |
public void copyArea (int srcX, int srcY, int width, int height, int destX, int destY, boolean paint) { |
| 505 |
srcX = DPIUtil.autoScaleUp(drawable, srcX); |
505 |
srcX = DPIUtil.autoScaleUp(this.device, drawable, srcX); |
| 506 |
srcY = DPIUtil.autoScaleUp(drawable, srcY); |
506 |
srcY = DPIUtil.autoScaleUp(this.device, drawable, srcY); |
| 507 |
width = DPIUtil.autoScaleUp(drawable, width); |
507 |
width = DPIUtil.autoScaleUp(this.device, drawable, width); |
| 508 |
height = DPIUtil.autoScaleUp(drawable, height); |
508 |
height = DPIUtil.autoScaleUp(this.device, drawable, height); |
| 509 |
destX = DPIUtil.autoScaleUp(drawable, destX); |
509 |
destX = DPIUtil.autoScaleUp(this.device, drawable, destX); |
| 510 |
destY = DPIUtil.autoScaleUp(drawable, destY); |
510 |
destY = DPIUtil.autoScaleUp(this.device, drawable, destY); |
| 511 |
copyAreaInPixels(srcX, srcY, width, height, destX, destY, paint); |
511 |
copyAreaInPixels(srcX, srcY, width, height, destX, destY, paint); |
| 512 |
} |
512 |
} |
| 513 |
|
513 |
|
|
Lines 743-752
Link Here
|
| 743 |
* </ul> |
743 |
* </ul> |
| 744 |
*/ |
744 |
*/ |
| 745 |
public void drawArc (int x, int y, int width, int height, int startAngle, int arcAngle) { |
745 |
public void drawArc (int x, int y, int width, int height, int startAngle, int arcAngle) { |
| 746 |
x = DPIUtil.autoScaleUp(drawable, x); |
746 |
x = DPIUtil.autoScaleUp(this.device, drawable, x); |
| 747 |
y = DPIUtil.autoScaleUp(drawable, y); |
747 |
y = DPIUtil.autoScaleUp(this.device, drawable, y); |
| 748 |
width = DPIUtil.autoScaleUp(drawable, width); |
748 |
width = DPIUtil.autoScaleUp(this.device, drawable, width); |
| 749 |
height = DPIUtil.autoScaleUp(drawable, height); |
749 |
height = DPIUtil.autoScaleUp(this.device, drawable, height); |
| 750 |
drawArcInPixels(x, y, width, height, startAngle, arcAngle); |
750 |
drawArcInPixels(x, y, width, height, startAngle, arcAngle); |
| 751 |
} |
751 |
} |
| 752 |
|
752 |
|
|
Lines 849-858
Link Here
|
| 849 |
* @see #drawRectangle(int, int, int, int) |
849 |
* @see #drawRectangle(int, int, int, int) |
| 850 |
*/ |
850 |
*/ |
| 851 |
public void drawFocus (int x, int y, int width, int height) { |
851 |
public void drawFocus (int x, int y, int width, int height) { |
| 852 |
x = DPIUtil.autoScaleUp (drawable, x); |
852 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 853 |
y = DPIUtil.autoScaleUp (drawable, y); |
853 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 854 |
width = DPIUtil.autoScaleUp (drawable, width); |
854 |
width = DPIUtil.autoScaleUp (device, drawable, width); |
| 855 |
height = DPIUtil.autoScaleUp (drawable, height); |
855 |
height = DPIUtil.autoScaleUp (device, drawable, height); |
| 856 |
drawFocusInPixels(x, y, width, height); |
856 |
drawFocusInPixels(x, y, width, height); |
| 857 |
} |
857 |
} |
| 858 |
|
858 |
|
|
Lines 927-934
Link Here
|
| 927 |
* </ul> |
927 |
* </ul> |
| 928 |
*/ |
928 |
*/ |
| 929 |
public void drawImage (Image image, int x, int y) { |
929 |
public void drawImage (Image image, int x, int y) { |
| 930 |
x = DPIUtil.autoScaleUp(drawable, x); |
930 |
x = DPIUtil.autoScaleUp(this.device, drawable, x); |
| 931 |
y = DPIUtil.autoScaleUp(drawable, y); |
931 |
y = DPIUtil.autoScaleUp(this.device, drawable, y); |
| 932 |
drawImageInPixels(image, x, y); |
932 |
drawImageInPixels(image, x, y); |
| 933 |
} |
933 |
} |
| 934 |
|
934 |
|
|
Lines 980-988
Link Here
|
| 980 |
if (image == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); |
980 |
if (image == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); |
| 981 |
if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
981 |
if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
| 982 |
|
982 |
|
| 983 |
Rectangle src = DPIUtil.autoScaleUp(drawable, new Rectangle(srcX, srcY, srcWidth, srcHeight)); |
983 |
Rectangle src = DPIUtil.autoScaleUp(this.device, drawable, new Rectangle(srcX, srcY, srcWidth, srcHeight)); |
| 984 |
Rectangle dest = DPIUtil.autoScaleUp(drawable, new Rectangle(destX, destY, destWidth, destHeight)); |
984 |
Rectangle dest = DPIUtil.autoScaleUp(this.device, drawable, new Rectangle(destX, destY, destWidth, destHeight)); |
| 985 |
int deviceZoom = DPIUtil.getDeviceZoom(); |
985 |
int deviceZoom = device.getZoom(); |
| 986 |
if (deviceZoom != 100) { |
986 |
if (deviceZoom != 100) { |
| 987 |
/* |
987 |
/* |
| 988 |
* This is a HACK! Due to rounding errors at fractional scale factors, |
988 |
* This is a HACK! Due to rounding errors at fractional scale factors, |
|
Lines 1735-1744
Link Here
|
| 1735 |
* </ul> |
1735 |
* </ul> |
| 1736 |
*/ |
1736 |
*/ |
| 1737 |
public void drawLine (int x1, int y1, int x2, int y2) { |
1737 |
public void drawLine (int x1, int y1, int x2, int y2) { |
| 1738 |
x1 = DPIUtil.autoScaleUp (drawable, x1); |
1738 |
x1 = DPIUtil.autoScaleUp (device, drawable, x1); |
| 1739 |
x2 = DPIUtil.autoScaleUp (drawable, x2); |
1739 |
x2 = DPIUtil.autoScaleUp (device, drawable, x2); |
| 1740 |
y1 = DPIUtil.autoScaleUp (drawable, y1); |
1740 |
y1 = DPIUtil.autoScaleUp (device, drawable, y1); |
| 1741 |
y2 = DPIUtil.autoScaleUp (drawable, y2); |
1741 |
y2 = DPIUtil.autoScaleUp (device, drawable, y2); |
| 1742 |
drawLineInPixels(x1, y1, x2, y2); |
1742 |
drawLineInPixels(x1, y1, x2, y2); |
| 1743 |
} |
1743 |
} |
| 1744 |
|
1744 |
|
|
Lines 1792-1801
Link Here
|
| 1792 |
* </ul> |
1792 |
* </ul> |
| 1793 |
*/ |
1793 |
*/ |
| 1794 |
public void drawOval (int x, int y, int width, int height) { |
1794 |
public void drawOval (int x, int y, int width, int height) { |
| 1795 |
x = DPIUtil.autoScaleUp (drawable, x); |
1795 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 1796 |
y = DPIUtil.autoScaleUp (drawable, y); |
1796 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 1797 |
width = DPIUtil.autoScaleUp (drawable, width); |
1797 |
width = DPIUtil.autoScaleUp (device, drawable, width); |
| 1798 |
height = DPIUtil.autoScaleUp (drawable, height); |
1798 |
height = DPIUtil.autoScaleUp (device, drawable, height); |
| 1799 |
drawOvalInPixels(x, y, width, height); |
1799 |
drawOvalInPixels(x, y, width, height); |
| 1800 |
} |
1800 |
} |
| 1801 |
|
1801 |
|
|
Lines 1868-1875
Link Here
|
| 1868 |
* @since 3.0 |
1868 |
* @since 3.0 |
| 1869 |
*/ |
1869 |
*/ |
| 1870 |
public void drawPoint (int x, int y) { |
1870 |
public void drawPoint (int x, int y) { |
| 1871 |
x = DPIUtil.autoScaleUp (drawable, x); |
1871 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 1872 |
y = DPIUtil.autoScaleUp (drawable, y); |
1872 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 1873 |
drawPointInPixels(x, y); |
1873 |
drawPointInPixels(x, y); |
| 1874 |
} |
1874 |
} |
| 1875 |
|
1875 |
|
|
Lines 1902-1908
Link Here
|
| 1902 |
*/ |
1902 |
*/ |
| 1903 |
public void drawPolygon (int[] pointArray) { |
1903 |
public void drawPolygon (int[] pointArray) { |
| 1904 |
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
1904 |
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
| 1905 |
drawPolygonInPixels(DPIUtil.autoScaleUp(drawable, pointArray)); |
1905 |
drawPolygonInPixels(DPIUtil.autoScaleUp(this.device, drawable, pointArray)); |
| 1906 |
} |
1906 |
} |
| 1907 |
|
1907 |
|
| 1908 |
void drawPolygonInPixels(int[] pointArray) { |
1908 |
void drawPolygonInPixels(int[] pointArray) { |
|
Lines 1950-1956
Link Here
|
| 1950 |
* </ul> |
1950 |
* </ul> |
| 1951 |
*/ |
1951 |
*/ |
| 1952 |
public void drawPolyline (int[] pointArray) { |
1952 |
public void drawPolyline (int[] pointArray) { |
| 1953 |
drawPolylineInPixels(DPIUtil.autoScaleUp(drawable, pointArray)); |
1953 |
drawPolylineInPixels(DPIUtil.autoScaleUp(this.device, drawable, pointArray)); |
| 1954 |
} |
1954 |
} |
| 1955 |
|
1955 |
|
| 1956 |
void drawPolylineInPixels(int[] pointArray) { |
1956 |
void drawPolylineInPixels(int[] pointArray) { |
|
Lines 2003-2012
Link Here
|
| 2003 |
* </ul> |
2003 |
* </ul> |
| 2004 |
*/ |
2004 |
*/ |
| 2005 |
public void drawRectangle (int x, int y, int width, int height) { |
2005 |
public void drawRectangle (int x, int y, int width, int height) { |
| 2006 |
x = DPIUtil.autoScaleUp (drawable, x); |
2006 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 2007 |
y = DPIUtil.autoScaleUp (drawable, y); |
2007 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 2008 |
width = DPIUtil.autoScaleUp (drawable, width); |
2008 |
width = DPIUtil.autoScaleUp (device, drawable, width); |
| 2009 |
height = DPIUtil.autoScaleUp (drawable, height); |
2009 |
height = DPIUtil.autoScaleUp (device, drawable, height); |
| 2010 |
drawRectangleInPixels(x, y, width, height); |
2010 |
drawRectangleInPixels(x, y, width, height); |
| 2011 |
} |
2011 |
} |
| 2012 |
|
2012 |
|
|
Lines 2062-2068
Link Here
|
| 2062 |
*/ |
2062 |
*/ |
| 2063 |
public void drawRectangle (Rectangle rect) { |
2063 |
public void drawRectangle (Rectangle rect) { |
| 2064 |
if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
2064 |
if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
| 2065 |
rect = DPIUtil.autoScaleUp(drawable, rect); |
2065 |
rect = DPIUtil.autoScaleUp(this.device, drawable, rect); |
| 2066 |
drawRectangleInPixels(rect.x, rect.y, rect.width, rect.height); |
2066 |
drawRectangleInPixels(rect.x, rect.y, rect.width, rect.height); |
| 2067 |
} |
2067 |
} |
| 2068 |
|
2068 |
|
|
Lines 2088-2099
Link Here
|
| 2088 |
* </ul> |
2088 |
* </ul> |
| 2089 |
*/ |
2089 |
*/ |
| 2090 |
public void drawRoundRectangle (int x, int y, int width, int height, int arcWidth, int arcHeight) { |
2090 |
public void drawRoundRectangle (int x, int y, int width, int height, int arcWidth, int arcHeight) { |
| 2091 |
x = DPIUtil.autoScaleUp (drawable, x); |
2091 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 2092 |
y = DPIUtil.autoScaleUp (drawable, y); |
2092 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 2093 |
width = DPIUtil.autoScaleUp (drawable, width); |
2093 |
width = DPIUtil.autoScaleUp (device, drawable, width); |
| 2094 |
height = DPIUtil.autoScaleUp (drawable, height); |
2094 |
height = DPIUtil.autoScaleUp (device, drawable, height); |
| 2095 |
arcWidth = DPIUtil.autoScaleUp (drawable, arcWidth); |
2095 |
arcWidth = DPIUtil.autoScaleUp (device, drawable, arcWidth); |
| 2096 |
arcHeight = DPIUtil.autoScaleUp (drawable, arcHeight); |
2096 |
arcHeight = DPIUtil.autoScaleUp (device, drawable, arcHeight); |
| 2097 |
drawRoundRectangleInPixels(x, y, width, height, arcWidth, arcHeight); |
2097 |
drawRoundRectangleInPixels(x, y, width, height, arcWidth, arcHeight); |
| 2098 |
} |
2098 |
} |
| 2099 |
|
2099 |
|
|
Lines 2221-2228
Link Here
|
| 2221 |
* </ul> |
2221 |
* </ul> |
| 2222 |
*/ |
2222 |
*/ |
| 2223 |
public void drawString (String string, int x, int y) { |
2223 |
public void drawString (String string, int x, int y) { |
| 2224 |
x = DPIUtil.autoScaleUp(drawable, x); |
2224 |
x = DPIUtil.autoScaleUp(this.device, drawable, x); |
| 2225 |
y = DPIUtil.autoScaleUp(drawable, y); |
2225 |
y = DPIUtil.autoScaleUp(this.device, drawable, y); |
| 2226 |
drawStringInPixels(string, x, y, false); |
2226 |
drawStringInPixels(string, x, y, false); |
| 2227 |
} |
2227 |
} |
| 2228 |
|
2228 |
|
|
Lines 2247-2254
Link Here
|
| 2247 |
* </ul> |
2247 |
* </ul> |
| 2248 |
*/ |
2248 |
*/ |
| 2249 |
public void drawString (String string, int x, int y, boolean isTransparent) { |
2249 |
public void drawString (String string, int x, int y, boolean isTransparent) { |
| 2250 |
x = DPIUtil.autoScaleUp(drawable, x); |
2250 |
x = DPIUtil.autoScaleUp(this.device, drawable, x); |
| 2251 |
y = DPIUtil.autoScaleUp(drawable, y); |
2251 |
y = DPIUtil.autoScaleUp(this.device, drawable, y); |
| 2252 |
drawStringInPixels(string, x, y, isTransparent); |
2252 |
drawStringInPixels(string, x, y, isTransparent); |
| 2253 |
} |
2253 |
} |
| 2254 |
|
2254 |
|
|
Lines 2343-2350
Link Here
|
| 2343 |
* </ul> |
2343 |
* </ul> |
| 2344 |
*/ |
2344 |
*/ |
| 2345 |
public void drawText (String string, int x, int y) { |
2345 |
public void drawText (String string, int x, int y) { |
| 2346 |
x = DPIUtil.autoScaleUp(drawable, x); |
2346 |
x = DPIUtil.autoScaleUp(this.device, drawable, x); |
| 2347 |
y = DPIUtil.autoScaleUp(drawable, y); |
2347 |
y = DPIUtil.autoScaleUp(this.device, drawable, y); |
| 2348 |
drawTextInPixels(string, x, y); |
2348 |
drawTextInPixels(string, x, y); |
| 2349 |
} |
2349 |
} |
| 2350 |
|
2350 |
|
|
Lines 2373-2380
Link Here
|
| 2373 |
* </ul> |
2373 |
* </ul> |
| 2374 |
*/ |
2374 |
*/ |
| 2375 |
public void drawText (String string, int x, int y, boolean isTransparent) { |
2375 |
public void drawText (String string, int x, int y, boolean isTransparent) { |
| 2376 |
x = DPIUtil.autoScaleUp(drawable, x); |
2376 |
x = DPIUtil.autoScaleUp(this.device, drawable, x); |
| 2377 |
y = DPIUtil.autoScaleUp(drawable, y); |
2377 |
y = DPIUtil.autoScaleUp(this.device, drawable, y); |
| 2378 |
drawTextInPixels(string, x, y, isTransparent); |
2378 |
drawTextInPixels(string, x, y, isTransparent); |
| 2379 |
} |
2379 |
} |
| 2380 |
|
2380 |
|
|
Lines 2419-2426
Link Here
|
| 2419 |
* </ul> |
2419 |
* </ul> |
| 2420 |
*/ |
2420 |
*/ |
| 2421 |
public void drawText (String string, int x, int y, int flags) { |
2421 |
public void drawText (String string, int x, int y, int flags) { |
| 2422 |
x = DPIUtil.autoScaleUp(drawable, x); |
2422 |
x = DPIUtil.autoScaleUp(this.device, drawable, x); |
| 2423 |
y = DPIUtil.autoScaleUp(drawable, y); |
2423 |
y = DPIUtil.autoScaleUp(this.device, drawable, y); |
| 2424 |
drawTextInPixels(string, x, y, flags); |
2424 |
drawTextInPixels(string, x, y, flags); |
| 2425 |
} |
2425 |
} |
| 2426 |
|
2426 |
|
|
Lines 2820-2829
Link Here
|
| 2820 |
* @see #drawArc |
2820 |
* @see #drawArc |
| 2821 |
*/ |
2821 |
*/ |
| 2822 |
public void fillArc (int x, int y, int width, int height, int startAngle, int arcAngle) { |
2822 |
public void fillArc (int x, int y, int width, int height, int startAngle, int arcAngle) { |
| 2823 |
x = DPIUtil.autoScaleUp (drawable, x); |
2823 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 2824 |
y = DPIUtil.autoScaleUp (drawable, y); |
2824 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 2825 |
width = DPIUtil.autoScaleUp (drawable, width); |
2825 |
width = DPIUtil.autoScaleUp (device, drawable, width); |
| 2826 |
height = DPIUtil.autoScaleUp (drawable, height); |
2826 |
height = DPIUtil.autoScaleUp (device, drawable, height); |
| 2827 |
fillArcInPixels(x, y, width, height, startAngle, arcAngle); |
2827 |
fillArcInPixels(x, y, width, height, startAngle, arcAngle); |
| 2828 |
} |
2828 |
} |
| 2829 |
|
2829 |
|
|
Lines 2929-2938
Link Here
|
| 2929 |
* @see #drawRectangle(int, int, int, int) |
2929 |
* @see #drawRectangle(int, int, int, int) |
| 2930 |
*/ |
2930 |
*/ |
| 2931 |
public void fillGradientRectangle (int x, int y, int width, int height, boolean vertical) { |
2931 |
public void fillGradientRectangle (int x, int y, int width, int height, boolean vertical) { |
| 2932 |
x = DPIUtil.autoScaleUp (drawable, x); |
2932 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 2933 |
y = DPIUtil.autoScaleUp (drawable, y); |
2933 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 2934 |
width = DPIUtil.autoScaleUp (drawable, width); |
2934 |
width = DPIUtil.autoScaleUp (device, drawable, width); |
| 2935 |
height = DPIUtil.autoScaleUp (drawable, height); |
2935 |
height = DPIUtil.autoScaleUp (device, drawable, height); |
| 2936 |
fillGradientRectangleInPixels(x, y, width, height, vertical); |
2936 |
fillGradientRectangleInPixels(x, y, width, height, vertical); |
| 2937 |
} |
2937 |
} |
| 2938 |
|
2938 |
|
|
Lines 3063-3072
Link Here
|
| 3063 |
* @see #drawOval |
3063 |
* @see #drawOval |
| 3064 |
*/ |
3064 |
*/ |
| 3065 |
public void fillOval (int x, int y, int width, int height) { |
3065 |
public void fillOval (int x, int y, int width, int height) { |
| 3066 |
x = DPIUtil.autoScaleUp (drawable, x); |
3066 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 3067 |
y = DPIUtil.autoScaleUp (drawable, y); |
3067 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 3068 |
width = DPIUtil.autoScaleUp (drawable, width); |
3068 |
width = DPIUtil.autoScaleUp (device, drawable, width); |
| 3069 |
height = DPIUtil.autoScaleUp (drawable, height); |
3069 |
height = DPIUtil.autoScaleUp (device, drawable, height); |
| 3070 |
fillOvalInPixels(x, y, width, height); |
3070 |
fillOvalInPixels(x, y, width, height); |
| 3071 |
} |
3071 |
} |
| 3072 |
|
3072 |
|
|
Lines 3136-3142
Link Here
|
| 3136 |
*/ |
3136 |
*/ |
| 3137 |
public void fillPolygon (int[] pointArray) { |
3137 |
public void fillPolygon (int[] pointArray) { |
| 3138 |
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
3138 |
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
| 3139 |
fillPolygonInPixels(DPIUtil.autoScaleUp(drawable, pointArray)); |
3139 |
fillPolygonInPixels(DPIUtil.autoScaleUp(this.device, drawable, pointArray)); |
| 3140 |
} |
3140 |
} |
| 3141 |
|
3141 |
|
| 3142 |
void fillPolygonInPixels (int[] pointArray) { |
3142 |
void fillPolygonInPixels (int[] pointArray) { |
|
Lines 3176-3185
Link Here
|
| 3176 |
* @see #drawRectangle(int, int, int, int) |
3176 |
* @see #drawRectangle(int, int, int, int) |
| 3177 |
*/ |
3177 |
*/ |
| 3178 |
public void fillRectangle (int x, int y, int width, int height) { |
3178 |
public void fillRectangle (int x, int y, int width, int height) { |
| 3179 |
x = DPIUtil.autoScaleUp (drawable, x); |
3179 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 3180 |
y = DPIUtil.autoScaleUp (drawable, y); |
3180 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 3181 |
width = DPIUtil.autoScaleUp (drawable, width); |
3181 |
width = DPIUtil.autoScaleUp (device, drawable, width); |
| 3182 |
height = DPIUtil.autoScaleUp (drawable, height); |
3182 |
height = DPIUtil.autoScaleUp (device, drawable, height); |
| 3183 |
fillRectangleInPixels(x, y, width, height); |
3183 |
fillRectangleInPixels(x, y, width, height); |
| 3184 |
} |
3184 |
} |
| 3185 |
|
3185 |
|
|
Lines 3226-3232
Link Here
|
| 3226 |
*/ |
3226 |
*/ |
| 3227 |
public void fillRectangle (Rectangle rect) { |
3227 |
public void fillRectangle (Rectangle rect) { |
| 3228 |
if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
3228 |
if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
| 3229 |
rect = DPIUtil.autoScaleUp(drawable, rect); |
3229 |
rect = DPIUtil.autoScaleUp(this.device, drawable, rect); |
| 3230 |
fillRectangleInPixels(rect.x, rect.y, rect.width, rect.height); |
3230 |
fillRectangleInPixels(rect.x, rect.y, rect.width, rect.height); |
| 3231 |
} |
3231 |
} |
| 3232 |
|
3232 |
|
|
Lines 3248-3259
Link Here
|
| 3248 |
* @see #drawRoundRectangle |
3248 |
* @see #drawRoundRectangle |
| 3249 |
*/ |
3249 |
*/ |
| 3250 |
public void fillRoundRectangle (int x, int y, int width, int height, int arcWidth, int arcHeight) { |
3250 |
public void fillRoundRectangle (int x, int y, int width, int height, int arcWidth, int arcHeight) { |
| 3251 |
x = DPIUtil.autoScaleUp (drawable, x); |
3251 |
x = DPIUtil.autoScaleUp (device, drawable, x); |
| 3252 |
y = DPIUtil.autoScaleUp (drawable, y); |
3252 |
y = DPIUtil.autoScaleUp (device, drawable, y); |
| 3253 |
width = DPIUtil.autoScaleUp (drawable, width); |
3253 |
width = DPIUtil.autoScaleUp (device, drawable, width); |
| 3254 |
height = DPIUtil.autoScaleUp (drawable, height); |
3254 |
height = DPIUtil.autoScaleUp (device, drawable, height); |
| 3255 |
arcWidth = DPIUtil.autoScaleUp (drawable, arcWidth); |
3255 |
arcWidth = DPIUtil.autoScaleUp (device, drawable, arcWidth); |
| 3256 |
arcHeight = DPIUtil.autoScaleUp (drawable, arcHeight); |
3256 |
arcHeight = DPIUtil.autoScaleUp (device, drawable, arcHeight); |
| 3257 |
fillRoundRectangleInPixels(x, y, width, height, arcWidth, arcHeight); |
3257 |
fillRoundRectangleInPixels(x, y, width, height, arcWidth, arcHeight); |
| 3258 |
} |
3258 |
} |
| 3259 |
|
3259 |
|
|
Lines 3529-3535
Link Here
|
| 3529 |
* </ul> |
3529 |
* </ul> |
| 3530 |
*/ |
3530 |
*/ |
| 3531 |
public Rectangle getClipping () { |
3531 |
public Rectangle getClipping () { |
| 3532 |
return DPIUtil.autoScaleDown(drawable, getClippingInPixels()); |
3532 |
return DPIUtil.autoScaleDown(this.device, drawable, getClippingInPixels()); |
| 3533 |
} |
3533 |
} |
| 3534 |
|
3534 |
|
| 3535 |
Rectangle getClippingInPixels() { |
3535 |
Rectangle getClippingInPixels() { |
|
Lines 3698-3704
Link Here
|
| 3698 |
checkGC(FONT); |
3698 |
checkGC(FONT); |
| 3699 |
TEXTMETRIC lptm = OS.IsUnicode ? (TEXTMETRIC)new TEXTMETRICW() : new TEXTMETRICA(); |
3699 |
TEXTMETRIC lptm = OS.IsUnicode ? (TEXTMETRIC)new TEXTMETRICW() : new TEXTMETRICA(); |
| 3700 |
OS.GetTextMetrics(handle, lptm); |
3700 |
OS.GetTextMetrics(handle, lptm); |
| 3701 |
return FontMetrics.win32_new(lptm); |
3701 |
return FontMetrics.win32_new(device, lptm); |
| 3702 |
} |
3702 |
} |
| 3703 |
|
3703 |
|
| 3704 |
/** |
3704 |
/** |
|
Lines 3804-3810
Link Here
|
| 3804 |
*/ |
3804 |
*/ |
| 3805 |
public LineAttributes getLineAttributes () { |
3805 |
public LineAttributes getLineAttributes () { |
| 3806 |
LineAttributes attributes = getLineAttributesInPixels(); |
3806 |
LineAttributes attributes = getLineAttributesInPixels(); |
| 3807 |
attributes.width = DPIUtil.autoScaleDown(drawable, attributes.width); |
3807 |
attributes.width = DPIUtil.autoScaleDown(this.device, drawable, attributes.width); |
| 3808 |
return attributes; |
3808 |
return attributes; |
| 3809 |
} |
3809 |
} |
| 3810 |
|
3810 |
|
|
Lines 3906-3912
Link Here
|
| 3906 |
* </ul> |
3906 |
* </ul> |
| 3907 |
*/ |
3907 |
*/ |
| 3908 |
public int getLineWidth () { |
3908 |
public int getLineWidth () { |
| 3909 |
return DPIUtil.autoScaleDown(drawable, getLineWidthInPixels()); |
3909 |
return DPIUtil.autoScaleDown(this.device, drawable, getLineWidthInPixels()); |
| 3910 |
} |
3910 |
} |
| 3911 |
|
3911 |
|
| 3912 |
int getLineWidthInPixels() { |
3912 |
int getLineWidthInPixels() { |
|
Lines 4470-4479
Link Here
|
| 4470 |
* </ul> |
4470 |
* </ul> |
| 4471 |
*/ |
4471 |
*/ |
| 4472 |
public void setClipping (int x, int y, int width, int height) { |
4472 |
public void setClipping (int x, int y, int width, int height) { |
| 4473 |
x = DPIUtil.autoScaleUp(drawable, x); |
4473 |
x = DPIUtil.autoScaleUp(this.device, drawable, x); |
| 4474 |
y = DPIUtil.autoScaleUp(drawable, y); |
4474 |
y = DPIUtil.autoScaleUp(this.device, drawable, y); |
| 4475 |
width = DPIUtil.autoScaleUp(drawable, width); |
4475 |
width = DPIUtil.autoScaleUp(this.device, drawable, width); |
| 4476 |
height = DPIUtil.autoScaleUp(drawable, height); |
4476 |
height = DPIUtil.autoScaleUp(this.device, drawable, height); |
| 4477 |
setClippingInPixels(x, y, width, height); |
4477 |
setClippingInPixels(x, y, width, height); |
| 4478 |
} |
4478 |
} |
| 4479 |
|
4479 |
|
|
Lines 4541-4547
Link Here
|
| 4541 |
setClipping(0); |
4541 |
setClipping(0); |
| 4542 |
} |
4542 |
} |
| 4543 |
else { |
4543 |
else { |
| 4544 |
rect = DPIUtil.autoScaleUp(drawable, rect); |
4544 |
rect = DPIUtil.autoScaleUp(this.device, drawable, rect); |
| 4545 |
setClippingInPixels(rect.x, rect.y, rect.width, rect.height); |
4545 |
setClippingInPixels(rect.x, rect.y, rect.width, rect.height); |
| 4546 |
} |
4546 |
} |
| 4547 |
} |
4547 |
} |
|
Lines 4744-4750
Link Here
|
| 4744 |
*/ |
4744 |
*/ |
| 4745 |
public void setLineAttributes (LineAttributes attributes) { |
4745 |
public void setLineAttributes (LineAttributes attributes) { |
| 4746 |
if (attributes == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
4746 |
if (attributes == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
| 4747 |
attributes.width = DPIUtil.autoScaleUp(drawable, attributes.width); |
4747 |
attributes.width = DPIUtil.autoScaleUp(this.device, drawable, attributes.width); |
| 4748 |
setLineAttributesInPixels(attributes); |
4748 |
setLineAttributesInPixels(attributes); |
| 4749 |
} |
4749 |
} |
| 4750 |
|
4750 |
|
|
Lines 4997-5003
Link Here
|
| 4997 |
* </ul> |
4997 |
* </ul> |
| 4998 |
*/ |
4998 |
*/ |
| 4999 |
public void setLineWidth(int lineWidth) { |
4999 |
public void setLineWidth(int lineWidth) { |
| 5000 |
lineWidth = DPIUtil.autoScaleUp (drawable, lineWidth); |
5000 |
lineWidth = DPIUtil.autoScaleUp (device, drawable, lineWidth); |
| 5001 |
setLineWidthInPixels(lineWidth); |
5001 |
setLineWidthInPixels(lineWidth); |
| 5002 |
} |
5002 |
} |
| 5003 |
|
5003 |
|
|
Lines 5151-5157
Link Here
|
| 5151 |
*/ |
5151 |
*/ |
| 5152 |
public Point stringExtent (String string) { |
5152 |
public Point stringExtent (String string) { |
| 5153 |
if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); |
5153 |
if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); |
| 5154 |
return DPIUtil.autoScaleDown(drawable, stringExtentInPixels(string)); |
5154 |
return DPIUtil.autoScaleDown(this.device, drawable, stringExtentInPixels(string)); |
| 5155 |
} |
5155 |
} |
| 5156 |
|
5156 |
|
| 5157 |
Point stringExtentInPixels (String string) { |
5157 |
Point stringExtentInPixels (String string) { |
|
Lines 5198-5204
Link Here
|
| 5198 |
* </ul> |
5198 |
* </ul> |
| 5199 |
*/ |
5199 |
*/ |
| 5200 |
public Point textExtent (String string) { |
5200 |
public Point textExtent (String string) { |
| 5201 |
return DPIUtil.autoScaleDown(drawable, textExtentInPixels(string, SWT.DRAW_DELIMITER | SWT.DRAW_TAB)); |
5201 |
return DPIUtil.autoScaleDown(this.device, drawable, textExtentInPixels(string, SWT.DRAW_DELIMITER | SWT.DRAW_TAB)); |
| 5202 |
} |
5202 |
} |
| 5203 |
|
5203 |
|
| 5204 |
/** |
5204 |
/** |
|
Lines 5233-5239
Link Here
|
| 5233 |
* </ul> |
5233 |
* </ul> |
| 5234 |
*/ |
5234 |
*/ |
| 5235 |
public Point textExtent (String string, int flags) { |
5235 |
public Point textExtent (String string, int flags) { |
| 5236 |
return DPIUtil.autoScaleDown(drawable, textExtentInPixels(string, flags)); |
5236 |
return DPIUtil.autoScaleDown(this.device, drawable, textExtentInPixels(string, flags)); |
| 5237 |
} |
5237 |
} |
| 5238 |
|
5238 |
|
| 5239 |
Point textExtentInPixels(String string, int flags) { |
5239 |
Point textExtentInPixels(String string, int flags) { |