Cabbage Logo
Back to Cabbage Site

Curious question

I was trying something a bit different in creating the initial bounding box that I am using. Originally, I was using this to create that bounding box…

iW cabbageGet "form", "width"
iH cabbageGet "form", "height"
iBB[] = fillarray(0, 0, iW, iH)

But I was thinking it would be quicker to just grab the bounding box of the “form” object using…

iBB[] cabbageGet "form, "bounds"

But what is returned from this is an array with (10, 10, iW, iH)…

Is there a reason why the bounds has that offset of 10? I mean, when I create a bounding box manually, it will still creates the objects with a 0, 0 origin. Does Cabbage do something with that offset?


For the form, that’s odd. But I would never have expected anything useful in the x/y parts here. size() is probably a better option. All the same, let me see why this is happening…

Good spot. I was indeed setting their default values to 10. It has gone unnoticed all this time :roll_eyes: Anyway, I just pushed a fix for this now. :+1:

1 Like