Apparently it might not be a bug after all. The drawable I am using,
which I implement myself, did not override IntrinsicWidth and
IntrinsicHeight, which seems to be what the bounds are calculated
from. If they are not overridden they just return -1 and hence the
funny bounds.

On Sat, Dec 17, 2011 at 4:47 PM, Tomasz Cielecki <tom...@ostebaronen.dk> wrote:
> Hey there,
>
> I have discovered some issues with the BoundCenterBottom and
> BoundCenter static methods on the ItemizedOverlay, which are supposed
> to center the Drawables so that (0,0) is either in the middle of the
> bottom edge of the Drawable or dead center in it.
>
> I have discovered that these two methods always return a Drawable with
> strange Bounds.
>
> BoundCenterBottom returns the bounds: (left, top, right, bottom) (0, 2, -1, 
> -1)
> BoundCenter returns the bounds: (left, top, right, bottom) (0, 0, -1, -1)
>
> This results in that the Drawable will not get shown as the width and
> height will be -1 and 1 in BoundCenterBottom and -1 and -1 in
> BoundCenter.
>
> What I do is to create an OverlayItem, then a Drawable, I set the its
> bounds as otherwise they will be 0. Then I use the setMarker method of
> the OverlayItem to set it to the my Drawable. Like so:
>
> OverlayItem item = new OverlayItem(...);
> Drawable drawable = new MyDrawable(); //MyDrawable is my own class
> which draws a simple circle on the canvas.
> drawable.Bounds = new Rect(0,0, 60, 60);
> item.SetMarker(drawable);
>
> Then if I run:
> Drawable dd = BoundCenterBottom(drawable);
> or
> Drawable dd = BoundCenter(drawable);
>
> The bounds become like I described above.
>
> Anyone experience this?
> --
> Med Venlig Hilsen / With Best Regards
> Tomasz Cielecki
> http://ostebaronen.dk



-- 
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
http://ostebaronen.dk
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to