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
Thanks to the new resize scale option, the image gets resized as desired.
Though as you can notice, the alignment of the image to the left is aesthetically unpleasing. If you know the width and height of the resized image, it can be centered easily:
I could determine the image dimensions, but that would involve doing what the library already does - calculating what the image dimensions are (while I can divide the image dimensions with font size, that would return the dimensions of the original image and not of the resized). Either there should be a function that makes the image centered or atleast a function where you give it available area and it tells what will be the image dimensions
The text was updated successfully, but these errors were encountered:
Yeah but that works only for fixed image. I thought it was implied that I asked for such a function for StatefulProtocol. It has area function aswell but it apparently always returns Rect::default() (I mean it obviously shouldn't work as the area depends on the available area). What I am asking for is a method of StatefulProtocol that takes a rect as an input, and returns a rect of what would the image render to
Okay I understand this a bit better now. I'm on the fence between providing some AreaAlignment (not to be confused with crop-alignment option) similar to the Resize option, or adding a method like resized_area and let the user do whatever with that.
In the meantime, you could actually hack it yourself already, but with some types that I now think shouldn't actually be public: 8c6bf46
Thanks to the new resize scale option, the image gets resized as desired.
Though as you can notice, the alignment of the image to the left is aesthetically unpleasing. If you know the width and height of the resized image, it can be centered easily:
I could determine the image dimensions, but that would involve doing what the library already does - calculating what the image dimensions are (while I can divide the image dimensions with font size, that would return the dimensions of the original image and not of the resized). Either there should be a function that makes the image centered or atleast a function where you give it available area and it tells what will be the image dimensions
The text was updated successfully, but these errors were encountered: