You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment to transform an image b.transformImage(img, x, y, width, height) has to be used. All the b.itemX, b.itemWidth and so on commands cannot be used as setters, as only the frame will be transformed, not the image itself.
If I for example want to scale an image in place, I will have to get all four values just to do that: x, y, width, height. Same thing, if I want to move it to another position without scaling, I still have to get width and height first.
To make working with this easier we could either
1. Introduce methods like b.imageX(), b.imageY() and so on. Or simpler b.translateImage() and b.scaleImage() etc.
OR
2. (which I think would be better) Modify the behavior of b.itemX(), b.itemWidth() that they set the x, width etc. for both the image frame and it's contained graphic. In this scenario we would need to introduce a method to get the contained graphic somehow, in case this should be transformed by itself (which is a method I wanted to suggest anyways, as it can be very useful). So something like b.graphic(myImageFrame). This solution would keep everything clean in the sense that b.itemWidth() and b.itemSize() and so on can be used consistently for any item.
Thoughts?
The text was updated successfully, but these errors were encountered:
Ok, after thinking about this for a while now, version 1 does not make any sense to me anymore. I think version two is much cleaner and the way to go. Thus my suggestions:
Make all b.itemXXX() functions work for images, meaning treat any graphic as a child of its frame and transform it along.
Introduce some method to get the graphic of a frame, so it can be treated separately if the need arises. I would simply suggest b.graphic(frame).
Keep b.transformImage() for backwards compatibility reasons only. (Or we decide that the big new version 2.0 can break some compatibility and get rid of it altogether).
At the moment to transform an image
b.transformImage(img, x, y, width, height)
has to be used. All theb.itemX
,b.itemWidth
and so on commands cannot be used as setters, as only the frame will be transformed, not the image itself.If I for example want to scale an image in place, I will have to get all four values just to do that: x, y, width, height. Same thing, if I want to move it to another position without scaling, I still have to get width and height first.
To make working with this easier we could either1. Introduce methods likeb.imageX()
,b.imageY()
and so on. Or simplerb.translateImage()
andb.scaleImage()
etc.OR2. (which I think would be better)Modify the behavior ofb.itemX()
,b.itemWidth()
that they set thex
,width
etc. for both the image frame and it's contained graphic. In this scenario we would need to introduce a method to get the contained graphic somehow, in case this should be transformed by itself (which is a method I wanted to suggest anyways, as it can be very useful). So something likeb.graphic(myImageFrame)
. This solution would keep everything clean in the sense thatb.itemWidth()
andb.itemSize()
and so on can be used consistently for any item.Thoughts?
The text was updated successfully, but these errors were encountered: