View | Details | Raw Unified | Return to bug 146894 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/draw2d/DeferredUpdateManager.java (-1 / +16 lines)
Lines 55-60 Link Here
55
private boolean updateQueued = false;
55
private boolean updateQueued = false;
56
56
57
private boolean updating;
57
private boolean updating;
58
private boolean validating = false;
58
private RunnableChain afterUpdate;
59
private RunnableChain afterUpdate;
59
60
60
private static class RunnableChain {
61
private static class RunnableChain {
Lines 137-152 Link Here
137
138
138
void paint(GC gc) {
139
void paint(GC gc) {
139
	SWTGraphics graphics = new SWTGraphics(gc);
140
	SWTGraphics graphics = new SWTGraphics(gc);
141
	Rectangle rect = graphics.getClip(new Rectangle());
140
	if (!updating) {
142
	if (!updating) {
141
		/**
143
		/**
142
		 * If a paint occurs not as part of an update, we should notify that the region
144
		 * If a paint occurs not as part of an update, we should notify that the region
143
		 * is being painted. Otherwise, notification already occurs in repairDamage().
145
		 * is being painted. Otherwise, notification already occurs in repairDamage().
144
		 */
146
		 */
145
		HashMap map = new HashMap();
147
		HashMap map = new HashMap();
146
		Rectangle rect = graphics.getClip(new Rectangle());
147
		map.put(root, rect);
148
		map.put(root, rect);
148
		firePainting(rect, map);
149
		firePainting(rect, map);
150
	} else {
151
		/*
152
		 * If figures are being validated (as part of an update) then we can simply
153
		 * add a dirty region here and update will repaint this region with other 
154
		 * dirty regions when it gets to painting. We can't paint if we're not sure
155
		 * that all figures are valid. 
156
		 */
157
		if (validating) {
158
			addDirtyRegion(root, rect);
159
			return;
160
		}
149
	}
161
	}
162
	performValidation();
150
	root.paint(graphics);
163
	root.paint(graphics);
151
	graphics.dispose();
164
	graphics.dispose();
152
}
165
}
Lines 185-190 Link Here
185
		return;
198
		return;
186
	try {
199
	try {
187
		IFigure fig;
200
		IFigure fig;
201
		validating = true;
188
		fireValidating();
202
		fireValidating();
189
		for (int i = 0; i < invalidFigures.size(); i++) {
203
		for (int i = 0; i < invalidFigures.size(); i++) {
190
			fig = (IFigure) invalidFigures.get(i);
204
			fig = (IFigure) invalidFigures.get(i);
Lines 193-198 Link Here
193
		}
207
		}
194
	} finally {
208
	} finally {
195
		invalidFigures.clear();
209
		invalidFigures.clear();
210
		validating = false;
196
	}
211
	}
197
}
212
}
198
213

Return to bug 146894