Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 327693
Collapse All | Expand All

(-)src/org/eclipse/draw2d/SWTGraphics.java (-13 / +19 lines)
Lines 145-153 Link Here
145
		public void setOn(GC gc, int translateX, int translateY) {
145
		public void setOn(GC gc, int translateX, int translateY) {
146
			int xInt = (int) Math.floor(left);
146
			int xInt = (int) Math.floor(left);
147
			int yInt = (int) Math.floor(top);
147
			int yInt = (int) Math.floor(top);
148
			gc.setClipping(xInt + translateX, yInt + translateY,
148
			gc.setClipping(xInt + translateX, yInt + translateY, (int) Math
149
					(int) Math.ceil(right) - xInt, (int) Math.ceil(bottom)
149
					.ceil(right)
150
							- yInt);
150
					- xInt, (int) Math.ceil(bottom) - yInt);
151
		}
151
		}
152
152
153
		public void translate(float dx, float dy) {
153
		public void translate(float dx, float dy) {
Lines 226-232 Link Here
226
226
227
		AA_MASK = 3 << AA_SHIFT;
227
		AA_MASK = 3 << AA_SHIFT;
228
		FILL_RULE_MASK = 1 << FILL_RULE_SHIFT; // If changed to more than 1-bit,
228
		FILL_RULE_MASK = 1 << FILL_RULE_SHIFT; // If changed to more than 1-bit,
229
												// check references!
229
		// check references!
230
		INTERPOLATION_MASK = 3 << INTERPOLATION_SHIFT;
230
		INTERPOLATION_MASK = 3 << INTERPOLATION_SHIFT;
231
		TEXT_AA_MASK = 3 << TEXT_AA_SHIFT;
231
		TEXT_AA_MASK = 3 << TEXT_AA_SHIFT;
232
		XOR_MASK = 1 << XOR_SHIFT;
232
		XOR_MASK = 1 << XOR_SHIFT;
Lines 364-371 Link Here
364
		}
364
		}
365
365
366
		checkSharedClipping();
366
		checkSharedClipping();
367
		currentState.relativeClip.intersect(rect.x, rect.y, rect.right(),
367
		currentState.relativeClip.intersect(rect.x, rect.y, rect.right(), rect
368
				rect.bottom());
368
				.bottom());
369
		appliedState.relativeClip = null;
369
		appliedState.relativeClip = null;
370
	}
370
	}
371
371
Lines 558-564 Link Here
558
	 */
558
	 */
559
	public void fillGradient(int x, int y, int w, int h, boolean vertical) {
559
	public void fillGradient(int x, int y, int w, int h, boolean vertical) {
560
		checkPaint();
560
		checkPaint();
561
		gc.fillGradientRectangle(x + translateX, y + translateY, w, h, vertical);
561
		gc
562
				.fillGradientRectangle(x + translateX, y + translateY, w, h,
563
						vertical);
562
	}
564
	}
563
565
564
	/**
566
	/**
Lines 871-878 Link Here
871
		changes &= ~XOR_MASK;
873
		changes &= ~XOR_MASK;
872
		if (changes != 0) {
874
		if (changes != 0) {
873
			if ((changes & INTERPOLATION_MASK) != 0) {
875
			if ((changes & INTERPOLATION_MASK) != 0) {
874
				gc.setInterpolation(((hints & INTERPOLATION_MASK) >> INTERPOLATION_SHIFT)
876
				gc
875
						- INTERPOLATION_WHOLE_NUMBER);
877
						.setInterpolation(((hints & INTERPOLATION_MASK) >> INTERPOLATION_SHIFT)
878
								- INTERPOLATION_WHOLE_NUMBER);
876
			}
879
			}
877
880
878
			if ((changes & FILL_RULE_MASK) != 0) {
881
			if ((changes & FILL_RULE_MASK) != 0) {
Lines 1085-1092 Link Here
1085
		initTransform(false);
1088
		initTransform(false);
1086
		if (((appliedState.graphicHints ^ currentState.graphicHints) & FILL_RULE_MASK) != 0) {
1089
		if (((appliedState.graphicHints ^ currentState.graphicHints) & FILL_RULE_MASK) != 0) {
1087
			// If there is a pending change to the fill rule, apply it first.
1090
			// If there is a pending change to the fill rule, apply it first.
1088
			gc.setFillRule(((currentState.graphicHints & FILL_RULE_MASK) >> FILL_RULE_SHIFT)
1091
			gc
1089
					- FILL_RULE_WHOLE_NUMBER);
1092
					.setFillRule(((currentState.graphicHints & FILL_RULE_MASK) >> FILL_RULE_SHIFT)
1093
							- FILL_RULE_WHOLE_NUMBER);
1090
			// As long as the FILL_RULE is stored in a single bit, just toggling
1094
			// As long as the FILL_RULE is stored in a single bit, just toggling
1091
			// it works.
1095
			// it works.
1092
			appliedState.graphicHints ^= FILL_RULE_MASK;
1096
			appliedState.graphicHints ^= FILL_RULE_MASK;
Lines 1107-1114 Link Here
1107
		initTransform(false);
1111
		initTransform(false);
1108
		if (((appliedState.graphicHints ^ currentState.graphicHints) & FILL_RULE_MASK) != 0) {
1112
		if (((appliedState.graphicHints ^ currentState.graphicHints) & FILL_RULE_MASK) != 0) {
1109
			// If there is a pending change to the fill rule, apply it first.
1113
			// If there is a pending change to the fill rule, apply it first.
1110
			gc.setFillRule(((currentState.graphicHints & FILL_RULE_MASK) >> FILL_RULE_SHIFT)
1114
			gc
1111
					- FILL_RULE_WHOLE_NUMBER);
1115
					.setFillRule(((currentState.graphicHints & FILL_RULE_MASK) >> FILL_RULE_SHIFT)
1116
							- FILL_RULE_WHOLE_NUMBER);
1112
			// As long as the FILL_RULE is stored in a single bit, just toggling
1117
			// As long as the FILL_RULE is stored in a single bit, just toggling
1113
			// it works.
1118
			// it works.
1114
			appliedState.graphicHints ^= FILL_RULE_MASK;
1119
			appliedState.graphicHints ^= FILL_RULE_MASK;
Lines 1409-1414 Link Here
1409
			dest.miterLimit = src.miterLimit;
1414
			dest.miterLimit = src.miterLimit;
1410
			dest.style = src.style;
1415
			dest.style = src.style;
1411
			dest.width = src.width;
1416
			dest.width = src.width;
1417
			dest.dashOffset = src.dashOffset;
1412
1418
1413
			if (src.dash == null) {
1419
			if (src.dash == null) {
1414
				dest.dash = null;
1420
				dest.dash = null;

Return to bug 327693