View | Details | Raw Unified | Return to bug 145338
Collapse All | Expand All

(-)src/org/eclipse/gmf/runtime/diagram/ui/tools/TextDirectEditManager.java (-4 / +6 lines)
Lines 98-105 Link Here
98
				rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr*2, 0));
98
				rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr*2, 0));
99
			}
99
			}
100
100
101
			if (!rect.equals(new Rectangle(text.getBounds())))
101
			org.eclipse.swt.graphics.Rectangle newRect = text.computeTrim(rect.x, rect.y, rect.width, rect.height);
102
				text.setBounds(rect.x, rect.y, rect.width, rect.height);
102
			if (!newRect.equals(new Rectangle(text.getBounds())))
103
				text.setBounds(newRect.x, newRect.y, newRect.width, newRect.height);
103
		}
104
		}
104
105
105
	}
106
	}
Lines 124-131 Link Here
124
			int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
125
			int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
125
			rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
126
			rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
126
127
127
			if (!rect.equals(new Rectangle(text.getBounds())))
128
			org.eclipse.swt.graphics.Rectangle newRect = text.computeTrim(rect.x, rect.y, rect.width, rect.height);
128
				text.setBounds(rect.x, rect.y, rect.width, rect.height);
129
			if (!newRect.equals(new Rectangle(text.getBounds())))
130
				text.setBounds(newRect.x, newRect.y, newRect.width, newRect.height);
129
		}
131
		}
130
	}
132
	}
131
133

Return to bug 145338