deanbrowne / j4me

Automatically exported from code.google.com/p/j4me
1 stars 1 forks source link

Border width of the selection rectangle #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Writing my own component, I found that the border width of the selection  
rectangle is not constant and depends on component height.

see Component.paintRect 
int rounding = height / 4;

As I draw some quite large component then the border width grows up to 3 
or 4 pixels. Not so beautiful.

I will prefer to have a constant border width for any selection rectangle 
whatever could be  its size or apperance.

I patch the Component.paintRect method, as following :
int rounding = 5;

Original issue reported on code.google.com by jmherme...@gmail.com on 29 Jan 2008 at 1:40

GoogleCodeExporter commented 9 years ago
Hint: Using the Component.paintRect method for _large_ components will increase 
the
drawing time noticeably. It dependence on 'width' and 'height'. Reason is the
multiple call of 'fillRect'. I have written my own. 

Original comment by z...@gmx.com on 30 Jan 2008 at 1:15

GoogleCodeExporter commented 9 years ago
Hello jmhermelin! Before longer talking in mysteries here is the code of this
'drawBeveledRect'. 
It's in an usable state but there is still a need to colourize the frame in 
different
colours. For selection etc. Will be done after the weekend. Good luck!

Original comment by z...@gmx.com on 31 Jan 2008 at 7:16

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by deanbro...@gmail.com on 12 Feb 2008 at 12:20

GoogleCodeExporter commented 9 years ago
Fixed so the maximum rounding is now 5.  That value looks good whereas 6 can 
start to
look weird.

Also the borders for rounded rectangles are drawn now instead of doing fills.  
That
can improve performance on slow phones.  And it lets the background show 
through for
custom background painting.

Original comment by deanbro...@gmail.com on 16 Apr 2008 at 12:25