[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] FYI: ComponentUI clipping reverted
From: |
Mark Wielaard |
Subject: |
Re: [cp-patches] FYI: ComponentUI clipping reverted |
Date: |
Thu, 20 Oct 2005 01:43:24 +0200 |
Hi Roman,
On Wed, 2005-10-19 at 14:11 +0000, Roman Kennke wrote:
> 2005-10-19 Roman Kennke <address@hidden>
>
> * javax/swing/plaf/ComponentUI.java
> Filled empty blocks with comments.
> (update): Reverted my patch from 2005-10-12. This is wrong. If
> there
> are still clipping problems, then certainly in another area.
It is better to just state what you changed. Now I need to lookup your
change from 2005-10-12 first to make sense of it all.
> Index: java/awt/Component.java
> ===================================================================
> RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v
> retrieving revision 1.79
> diff -u -r1.79 Component.java
> --- java/awt/Component.java 4 Oct 2005 14:05:56 -0000 1.79
> +++ java/awt/Component.java 12 Oct 2005 15:23:03 -0000
> @@ -1402,17 +1402,14 @@
> peer.setBounds (x, y, width, height);
>
> // Erase old bounds and repaint new bounds for lightweights.
> - if (isLightweight() && isShowing ())
> + if (isLightweight() && isShowing())
> {
> if (parent != null)
> {
> Rectangle parentBounds = parent.getBounds();
> - Rectangle oldBounds = new Rectangle(parent.getX() + oldx,
> - parent.getY() + oldy,
> - oldwidth, oldheight);
> - Rectangle newBounds = new Rectangle(parent.getX() + x,
> - parent.getY() + y,
> - width, height);
> + Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth,
> + oldheight);
> + Rectangle newBounds = new Rectangle(x, y, width, height);
> Rectangle destroyed = oldBounds.union(newBounds);
> if (!destroyed.isEmpty())
> parent.repaint(0, destroyed.x, destroyed.y, destroyed.width,
This doesn't seem related to the ChangeLog message above. What you seem
to have committed is:
> --- classpath/classpath/javax/swing/plaf/ComponentUI.java 2005/10/12
> 15:20:54 1.11
> +++ classpath/classpath/javax/swing/plaf/ComponentUI.java 2005/10/19
> 14:09:07 1.12
> @@ -87,6 +87,7 @@
> */
> public ComponentUI()
> {
> + // Nothing to do here.
> }
>
>
> @@ -158,6 +159,8 @@
> */
> public void paint(Graphics g, JComponent c)
> {
> + // Nothing is done here. This method is meant to be overridden by
> + // subclasses.
> }
>
>
> @@ -184,7 +187,7 @@
> {
> g.setColor(c.getBackground());
> Rectangle clip = g.getClipBounds();
> - g.fillRect(clip.x, clip.y, clip.width, clip.height);
> + g.fillRect(0, 0, c.getWidth(), c.getHeight());
> }
> paint(g, c);
> }
You no longer need that g.getClipBounds() there.
Cheers,
Mark
signature.asc
Description: This is a digitally signed message part