Revision: 661 Author: allain.lalonde Date: Thu Aug 6 11:46:49 2009 Log: Made PHtmlView text follow node bounds. Became apparent when setting a background paint color. http://code.google.com/p/piccolo2d/source/detail?r=661
Modified: /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java ======================================= --- /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java Thu Aug 6 10:18:47 2009 +++ /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PHtmlView.java Thu Aug 6 11:46:49 2009 @@ -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(); } --~--~---------~--~----~------------~-------~--~----~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~----------~----~----~----~------~----~------~--~---