Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/src/processing/app/ui/EditorFooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public class EditorFooter extends Box {

static final int UNSELECTED = 0;
static final int SELECTED = 1;

static final int CIRCULAR_PADDING = 1;

Color[] textColor = new Color[2];
Color[] tabColor = new Color[2];
Expand Down Expand Up @@ -297,19 +299,20 @@ private void drawUpdates(Graphics2D g2) {
FontRenderContext frc = g2.getFontRenderContext();
final int GAP = 5;
final String updateLabel = "Updates";
String updatesStr = "" + updateCount;
String updatesStr = " " + updateCount + " ";
double countWidth = font.getStringBounds(updatesStr, frc).getWidth();
double countHeight = font.getStringBounds(updatesStr, frc).getHeight();
if (fontAscent > countWidth) {
countWidth = fontAscent;
}
float diameter = (float) (countWidth * 1.65f);
float diameter = (float) (2 * (Math.max(countHeight, countWidth)/2 + CIRCULAR_PADDING));
float ex = getWidth() - Editor.RIGHT_GUTTER - diameter;
float ey = (getHeight() - diameter) / 2;
g2.setColor(updateColor);
g2.fill(new Ellipse2D.Float(ex, ey, diameter, diameter));
g2.setColor(textColor[SELECTED]);
int baseline = (getHeight() + fontAscent) / 2;
g2.drawString(updatesStr, (int) (ex + (diameter - countWidth)/2), baseline);
g2.drawString(updatesStr, (int) (ex + (diameter - countWidth) / 2), baseline);
double updatesWidth = font.getStringBounds(updateLabel, frc).getWidth();
g2.setColor(textColor[UNSELECTED]);
updateLeft = (int) (ex - updatesWidth - GAP);
Expand Down