@@ -248,7 +248,15 @@ public void fillRect(int x, int y, int width, int height) {
248248 ctx .fillRect (x , y , width , height );
249249 }
250250
251+ public void draw3DRect (int x , int y , int width , int height , boolean raised ) {
252+ do3DRect (x , y , width , height , raised , false );
253+ }
254+
251255 public void fill3DRect (int x , int y , int width , int height , boolean raised ) {
256+ do3DRect (x , y , width , height , raised , true );
257+ }
258+
259+ private void do3DRect (int x , int y , int width2 , int height2 , boolean raised , boolean isFill ) {
252260 if (width <= 0 || height <= 0 )
253261 return ;
254262 Paint p = getPaint ();
@@ -261,7 +269,9 @@ public void fill3DRect(int x, int y, int width, int height, boolean raised) {
261269 } else if (p != c ) {
262270 setColor (c );
263271 }
264- fillRect (x + 1 , y + 1 , width - 2 , height - 2 );
272+ if (isFill ) {
273+ fillRect (x + 1 , y + 1 , width - 2 , height - 2 );
274+ }
265275 setColor (raised ? brighter : darker );
266276 // drawLine(x, y, x, y + height - 1);
267277 fillRect (x , y , 1 , height );
0 commit comments