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
Well I guess if you think about it its intuitive, because to what reference (virtual box) should it be aligned if there is no defined width? It works that way in other gems as well (like Prawn). But the docu could be better. At the moment only the "long" explanation of width hints that it only works in pair. Maybe just add "width has to be set to use alignment".
Image.from_text("abc \n abcabcabc", align: :center) could create an image that is as wide as the second line, and then center the first line within that image. In the absence of :width, max(text_width of each line) sounds like an intuitive fallback. It's not super efficient to iterate over the text twice, but I don't think that's a concern for Image.from_text.
What if it counts when iterating the first time and if no width is defined use that to set width? no need for double iteration correct? Or if you know the x number of characters where 1 character is equal to a number if pixels the chars*pix_pr_char=width
Not really intuitive, I guess I should merge both forms of
Image.from_text
:/The text was updated successfully, but these errors were encountered: