From 0fca78cc7e6c85923cc0f9431160fa07dc33fc4a Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 24 Aug 2011 11:08:10 +0200 Subject: [PATCH] Fixed position of the Label of command buttons. --- app/src/processing/app/EditorToolbar.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/EditorToolbar.java b/app/src/processing/app/EditorToolbar.java index 1d9121498..6b04aa2d9 100644 --- a/app/src/processing/app/EditorToolbar.java +++ b/app/src/processing/app/EditorToolbar.java @@ -172,8 +172,8 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key } // Serial button must be on the right - x1[SERIAL] = width - BUTTON_WIDTH - 3; - x2[SERIAL] = width - 3; + x1[SERIAL] = width - BUTTON_WIDTH - 14; + x2[SERIAL] = width - 14; } Graphics g = offscreen.getGraphics(); g.setColor(bgcolor); //getBackground()); @@ -198,9 +198,15 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key g2.drawString(status, statusX, statusY); */ if (currentRollover != -1) { - int statusY = (BUTTON_HEIGHT + g.getFontMetrics().getAscent()) / 2; + int statusY = (BUTTON_HEIGHT + g.getFontMetrics().getAscent()) / 2; String status = shiftPressed ? titleShift[currentRollover] : title[currentRollover]; - g.drawString(status, buttonCount * BUTTON_WIDTH + 3 * BUTTON_GAP, statusY); + if (currentRollover != SERIAL) + g.drawString(status, (buttonCount-1) * BUTTON_WIDTH + 3 * BUTTON_GAP, statusY); + else { + int statusX = x1[SERIAL] - BUTTON_GAP; + statusX -= g.getFontMetrics().stringWidth(status); + g.drawString(status, statusX, statusY); + } } screen.drawImage(offscreen, 0, 0, null);