feathersui-starling
feathersui-starling copied to clipboard
Callout: add optional, separate padding for arrow skins
When I set callout.padding = 100 on TextCalloutScreen with componentsExplorer example, the position of arrow looks strange. Arrow would not be placed in a range of callout.padding and arrow can not pointed at the origin button. Would this be fixed?
Thanks!
I find this like a bug.
In Callout class at line 1099:
protected var _verticalAlign:String = HorizontalAlign.CENTER;
It should probably be changed into:
protected var _verticalAlign:String = VerticalAlign.MIDDLE;
I will fix the incorrect verticalAlign default value.
If you would like to use padding that doesn't affect the arrow position, I recommend using a regular Callout with a LayoutGroup. Give the LayoutGroup a layout that supports padding, and add a Label as a child. It's a little more work, but it should do what you expect.
I'll consider adding an optional, separate padding specficially for the arrow in a future version of Feathers.
I see! Thank you.
Hi, Josh. I would like to ask why do you use static method for positionToRightOfOrigin function in Callout class. I need to change some behavior of positionToRightOfOrigin function to cope with the tween animation for Callout component. But static function is inconvenient to extend. Would you give me some advice?
Thank you very much!
I was thinking I should change that when I made some bug fixes in Callout recently. Originally, there was no origin property, and all of the automatic positioning happened in static functions. When I created the origin property to allow the origin to be changed or set without Callout.show(), I left some of the static functions alone because they already worked correctly, and I didn't feel like taking the risk of introducing new bugs by refactoring. However, ideally, that stuff should not be static. Perhaps it's time to consider refactoring.
By the way, can you post questions like this to the forum in the future? I try to keep Github issues strictly on topic.
I understand. Thanks for your quick response and friendly admonition.