diff --git a/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java b/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java index ba3951b..d916e2a 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java +++ b/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java @@ -144,6 +144,7 @@ label.setFont(font); label.setForeground(textColor); htmlBounds = new Rectangle(); + super.setBounds(0, 0, label.getPreferredSize().getWidth(), label.getPreferredSize().getHeight()); update(); } @@ -241,7 +242,7 @@ htmlView = BasicHTML.createHTMLView(label, htmlContent); final Rectangle2D bounds = getBounds(); - htmlBounds.setRect(0, 0, bounds.getWidth(), bounds.getHeight()); + htmlBounds.setRect(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()); repaint(); }