You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2009/08/03 17:42:12 UTC
patch per TerraMenuButtonSkin
Hi to all,
in TerraMenuButtonSkin there are some little things ...
- dead local store in getPreferredWidth()
if (height != -1) {
height = Math.max(height - (padding.top + padding.bottom + 2), 0);
}
but height inside this method is not used, is a mistake ? mhhh seems
yes, because this method is for the width ...
- int division result cast to double or float in paint() :
// original:
// graphics.setPaint(new GradientPaint(width / 2, 0, bevelColor,
// width / 2, height / 2, backgroundColor));
// new:
graphics.setPaint(new GradientPaint((float) width / 2, 0, bevelColor,
(float) width / 2, (float) height / 2, backgroundColor));
- int value cast to float and then passed to Math.round in paint()
// int tx = triggerBounds.x + Math.round((triggerBounds.width -
triggerIconShape.getBounds().width) / 2);
int tx = triggerBounds.x + ((triggerBounds.width -
triggerIconShape.getBounds().width) / 2);
and the same also for the line with ty ...
Tell me something.
Bye,
Sandro
Re: patch per TerraMenuButtonSkin
Posted by Greg Brown <gk...@mac.com>.
I haven't checked it in yet. You'll see it in my next commit.
On Aug 3, 2009, at 12:37 PM, Sandro Martini wrote:
> Hi Greg,
> excuse me, I've just synchronized with the trunk but this source
> doesn't have the modifications ... should I make them ?
>
> If i redo a Replace from \ Latest from Repository for this file, i see
> the version of 30/06/09 1.29 ... is a problem of my eclipse ? Or how i
> do synchronization ?
>
> Sandro
Re: patch per TerraMenuButtonSkin
Posted by Sandro Martini <sa...@gmail.com>.
Hi Greg,
excuse me, I've just synchronized with the trunk but this source
doesn't have the modifications ... should I make them ?
If i redo a Replace from \ Latest from Repository for this file, i see
the version of 30/06/09 1.29 ... is a problem of my eclipse ? Or how i
do synchronization ?
Sandro
Re: patch per TerraMenuButtonSkin
Posted by Greg Brown <gk...@mac.com>.
> - dead local store in getPreferredWidth()
> if (height != -1) {
> height = Math.max(height - (padding.top + padding.bottom
> + 2), 0);
> }
>
> but height inside this method is not used, is a mistake ? mhhh seems
> yes, because this method is for the width ...
Fixed.
> - int division result cast to double or float in paint() :
> // original:
> // graphics.setPaint(new GradientPaint(width / 2, 0,
> bevelColor,
> // width / 2, height / 2, backgroundColor));
> // new:
> graphics.setPaint(new GradientPaint((float) width / 2, 0,
> bevelColor,
> (float) width / 2, (float) height / 2, backgroundColor));
This is OK.
> - int value cast to float and then passed to Math.round in paint()
> // int tx = triggerBounds.x + Math.round((triggerBounds.width -
> triggerIconShape.getBounds().width) / 2);
> int tx = triggerBounds.x + ((triggerBounds.width -
> triggerIconShape.getBounds().width) / 2);
> and the same also for the line with ty ...
Removed the call to Math.round().