diff options
author | Veronika Irvine <veronika> | 2006-02-13 19:57:41 +0000 |
---|---|---|
committer | Veronika Irvine <veronika> | 2006-02-13 19:57:41 +0000 |
commit | 114e6c465cbd9c1ceb1764600c53f4accd217656 (patch) | |
tree | bbc8ca1b8b1b98e459cbe58dc6067f32ad458443 | |
parent | 3d0271ddcb119c851fef09714e5acc1bb775dc00 (diff) | |
download | eclipse.platform.swt-114e6c465cbd9c1ceb1764600c53f4accd217656.tar.gz eclipse.platform.swt-114e6c465cbd9c1ceb1764600c53f4accd217656.tar.xz eclipse.platform.swt-114e6c465cbd9c1ceb1764600c53f4accd217656.zip |
fix divide by zero error
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java index 729ea9794a..03e2702e50 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java @@ -361,14 +361,10 @@ void drawSelected(GC gc ) { if (!parent.single && closeRect.width > 0) maxImageWidth -= closeRect.width + INTERNAL_SPACING; if (imageBounds.width < maxImageWidth) { int imageX = xDraw; - int imageHeight = imageBounds.height; - int imageY = y + (height - imageHeight) / 2; + int imageY = y + (height - imageBounds.height) / 2; imageY += parent.onBottom ? -1 : 1; - int imageWidth = imageBounds.width * imageHeight / imageBounds.height; - gc.drawImage(image, - imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height, - imageX, imageY, imageWidth, imageHeight); - xDraw += imageWidth + INTERNAL_SPACING; + gc.drawImage(image, imageX, imageY); + xDraw += imageBounds.width + INTERNAL_SPACING; } } |