@@ -512,14 +512,10 @@ public void copyArea (int srcX, int srcY, int width, int height, int destX, int
512512 * @since 3.1
513513 */
514514public void copyArea (int srcX , int srcY , int width , int height , int destX , int destY , boolean paint ) {
515- int deviceZoom = getZoom ();
516- srcX = DPIUtil .scaleUp (drawable , srcX , deviceZoom );
517- srcY = DPIUtil .scaleUp (drawable , srcY , deviceZoom );
518- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
519- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
520- destX = DPIUtil .scaleUp (drawable , destX , deviceZoom );
521- destY = DPIUtil .scaleUp (drawable , destY , deviceZoom );
522- copyAreaInPixels (srcX , srcY , width , height , destX , destY , paint );
515+ int zoom = getZoom ();
516+ Rectangle sourceRect = DPIUtil .scaleUp (drawable , new Rectangle (srcX , srcY , width , height ), zoom );
517+ Rectangle destRect = DPIUtil .scaleUp (drawable , new Rectangle (destX , destY , width , height ), zoom );
518+ copyAreaInPixels (sourceRect .x , sourceRect .y , sourceRect .width , sourceRect .height , destRect .x , destRect .y , paint );
523519}
524520
525521void copyAreaInPixels (int srcX , int srcY , int width , int height , int destX , int destY , boolean paint ) {
@@ -759,12 +755,8 @@ void disposeGdip() {
759755 * </ul>
760756 */
761757public void drawArc (int x , int y , int width , int height , int startAngle , int arcAngle ) {
762- int deviceZoom = getZoom ();
763- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
764- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
765- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
766- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
767- drawArcInPixels (x , y , width , height , startAngle , arcAngle );
758+ Rectangle rect = DPIUtil .scaleUp (drawable , new Rectangle (x , y , width , height ), getZoom ());
759+ drawArcInPixels (rect .x , rect .y , rect .width , rect .height , startAngle , arcAngle );
768760}
769761
770762void drawArcInPixels (int x , int y , int width , int height , int startAngle , int arcAngle ) {
@@ -843,12 +835,8 @@ void drawArcInPixels (int x, int y, int width, int height, int startAngle, int a
843835 * @see #drawRectangle(int, int, int, int)
844836 */
845837public void drawFocus (int x , int y , int width , int height ) {
846- int deviceZoom = getZoom ();
847- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
848- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
849- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
850- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
851- drawFocusInPixels (x , y , width , height );
838+ Rectangle rect = DPIUtil .scaleUp (drawable , new Rectangle (x , y , width , height ), getZoom ());
839+ drawFocusInPixels (rect .x , rect .y , rect .width , rect .height );
852840}
853841
854842void drawFocusInPixels (int x , int y , int width , int height ) {
@@ -1696,12 +1684,8 @@ void drawLineInPixels (int x1, int y1, int x2, int y2) {
16961684 * </ul>
16971685 */
16981686public void drawOval (int x , int y , int width , int height ) {
1699- int deviceZoom = getZoom ();
1700- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
1701- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
1702- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
1703- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
1704- drawOvalInPixels (x , y , width , height );
1687+ Rectangle rect = DPIUtil .scaleUp (drawable , new Rectangle (x , y , width , height ), getZoom ());
1688+ drawOvalInPixels (rect .x , rect .y , rect .width , rect .height );
17051689}
17061690
17071691void drawOvalInPixels (int x , int y , int width , int height ) {
@@ -1910,12 +1894,7 @@ void drawPolylineInPixels(int[] pointArray) {
19101894 * </ul>
19111895 */
19121896public void drawRectangle (int x , int y , int width , int height ) {
1913- int deviceZoom = getZoom ();
1914- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
1915- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
1916- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
1917- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
1918- drawRectangleInPixels (x , y , width , height );
1897+ drawRectangle (new Rectangle (x , y , width , height ));
19191898}
19201899
19211900void drawRectangleInPixels (int x , int y , int width , int height ) {
@@ -1996,14 +1975,11 @@ public void drawRectangle (Rectangle rect) {
19961975 * </ul>
19971976 */
19981977public void drawRoundRectangle (int x , int y , int width , int height , int arcWidth , int arcHeight ) {
1999- int deviceZoom = getZoom ();
2000- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
2001- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
2002- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
2003- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
2004- arcWidth = DPIUtil .scaleUp (drawable , arcWidth , deviceZoom );
2005- arcHeight = DPIUtil .scaleUp (drawable , arcHeight , deviceZoom );
2006- drawRoundRectangleInPixels (x , y , width , height , arcWidth , arcHeight );
1978+ int zoom = getZoom ();
1979+ Rectangle rect = DPIUtil .scaleUp (drawable , new Rectangle (x , y , width , height ), zoom );
1980+ arcWidth = DPIUtil .scaleUp (drawable , arcWidth , zoom );
1981+ arcHeight = DPIUtil .scaleUp (drawable , arcHeight , zoom );
1982+ drawRoundRectangleInPixels (rect .x , rect .y , rect .width , rect .height , arcWidth , arcHeight );
20071983}
20081984
20091985void drawRoundRectangleInPixels (int x , int y , int width , int height , int arcWidth , int arcHeight ) {
@@ -2687,12 +2663,8 @@ public boolean equals (Object object) {
26872663 * @see #drawArc
26882664 */
26892665public void fillArc (int x , int y , int width , int height , int startAngle , int arcAngle ) {
2690- int deviceZoom = getZoom ();
2691- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
2692- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
2693- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
2694- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
2695- fillArcInPixels (x , y , width , height , startAngle , arcAngle );
2666+ Rectangle rect = DPIUtil .scaleUp (drawable , new Rectangle (x , y , width , height ), getZoom ());
2667+ fillArcInPixels (rect .x , rect .y , rect .width , rect .height , startAngle , arcAngle );
26962668}
26972669
26982670void fillArcInPixels (int x , int y , int width , int height , int startAngle , int arcAngle ) {
@@ -2767,12 +2739,8 @@ void fillArcInPixels (int x, int y, int width, int height, int startAngle, int a
27672739 * @see #drawRectangle(int, int, int, int)
27682740 */
27692741public void fillGradientRectangle (int x , int y , int width , int height , boolean vertical ) {
2770- int deviceZoom = getZoom ();
2771- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
2772- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
2773- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
2774- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
2775- fillGradientRectangleInPixels (x , y , width , height , vertical );
2742+ Rectangle rect = DPIUtil .scaleUp (drawable , new Rectangle (x , y , width , height ), getZoom ());
2743+ fillGradientRectangleInPixels (rect .x , rect .y , rect .width , rect .height , vertical );
27762744}
27772745
27782746void fillGradientRectangleInPixels (int x , int y , int width , int height , boolean vertical ) {
@@ -2886,12 +2854,8 @@ void fillGradientRectangleInPixels(int x, int y, int width, int height, boolean
28862854 * @see #drawOval
28872855 */
28882856public void fillOval (int x , int y , int width , int height ) {
2889- int deviceZoom = getZoom ();
2890- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
2891- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
2892- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
2893- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
2894- fillOvalInPixels (x , y , width , height );
2857+ Rectangle rect = DPIUtil .scaleUp (drawable , new Rectangle (x , y , width , height ), getZoom ());
2858+ fillOvalInPixels (rect .x , rect .y , rect .width , rect .height );
28952859}
28962860
28972861void fillOvalInPixels (int x , int y , int width , int height ) {
@@ -3010,12 +2974,7 @@ void fillPolygonInPixels (int[] pointArray) {
30102974 * @see #drawRectangle(int, int, int, int)
30112975 */
30122976public void fillRectangle (int x , int y , int width , int height ) {
3013- int deviceZoom = getZoom ();
3014- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
3015- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
3016- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
3017- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
3018- fillRectangleInPixels (x , y , width , height );
2977+ fillRectangle (new Rectangle (x , y , width , height ));
30192978}
30202979
30212980void fillRectangleInPixels (int x , int y , int width , int height ) {
@@ -3076,14 +3035,11 @@ public void fillRectangle (Rectangle rect) {
30763035 * @see #drawRoundRectangle
30773036 */
30783037public void fillRoundRectangle (int x , int y , int width , int height , int arcWidth , int arcHeight ) {
3079- int deviceZoom = getZoom ();
3080- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
3081- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
3082- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
3083- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
3084- arcWidth = DPIUtil .scaleUp (drawable , arcWidth , deviceZoom );
3085- arcHeight = DPIUtil .scaleUp (drawable , arcHeight , deviceZoom );
3086- fillRoundRectangleInPixels (x , y , width , height , arcWidth , arcHeight );
3038+ int zoom = getZoom ();
3039+ Rectangle rect = DPIUtil .scaleUp (drawable , new Rectangle (x , y , width , height ), zoom );
3040+ arcWidth = DPIUtil .scaleUp (drawable , arcWidth , zoom );
3041+ arcHeight = DPIUtil .scaleUp (drawable , arcHeight , zoom );
3042+ fillRoundRectangleInPixels (rect .x , rect .y , rect .width , rect .height , arcWidth , arcHeight );
30873043}
30883044
30893045void fillRoundRectangleInPixels (int x , int y , int width , int height , int arcWidth , int arcHeight ) {
@@ -4281,12 +4237,7 @@ void setClipping(long clipRgn) {
42814237 * </ul>
42824238 */
42834239public void setClipping (int x , int y , int width , int height ) {
4284- int deviceZoom = getZoom ();
4285- x = DPIUtil .scaleUp (drawable , x , deviceZoom );
4286- y = DPIUtil .scaleUp (drawable , y , deviceZoom );
4287- width = DPIUtil .scaleUp (drawable , width , deviceZoom );
4288- height = DPIUtil .scaleUp (drawable , height , deviceZoom );
4289- setClippingInPixels (x , y , width , height );
4240+ setClipping (new Rectangle (x , y , width , height ));
42904241}
42914242
42924243void setClippingInPixels (int x , int y , int width , int height ) {
0 commit comments