You'll need to do fillPaint.setStyle(Paint.Style.FILL) I think.
On Jun 21, 7:57 pm, CaptainSpam <[email protected]> wrote: > I'm having a problem getting drawRect to draw anything on a Canvas > from a MapView (i.e. as an Overlay) on 1.5 firmware. The strange > thing is, drawLine is working perfectly, and both work right with the > same code under 1.1. Was there anything that changed in this respect > between 1.1 and 1.5 I'm not taking into account? > > The relevant code is as follows (in snippet form): > (R.color.graticule_fill is #10FF3333; Graticule is an object that > indicates a 1x1 degree area on the earth's surface) > > Context mContext; // comes in from constructor > > static Paint fillPaint = new Paint(); > fillPaint.setColor(mContext.getResources().getColor > (R.color.graticule_fill)); > > protected void drawGraticuleFill(Canvas c, Projection pr, > Graticule g) { > // This method is called from draw(); c is passed in from > there, > // pr = mapView.getProjection(), g is provided by the class. > if (g == null) { > return; > } > > // Two Points, the top-left and bottom-right of the graticule, > taken from the > // current Projection > Point topleft = pr.toPixels(g.getTopLeftGeoPoint(), null); > Point bottomright = pr.toPixels(g.getBottomRightGeoPoint(), > null); > > // Should draw out a rectangle covering the graticule; this > works in 1.1, but > // doesn't seem to do anything in 1.5. > c.drawRect(new Rect(topleft.x, topleft.y, bottomright.x, > bottomright.y), fillPaint); > } > > (sorry if this snippet doesn't make much sense out of context, I can > provide more information if need be) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

