feathersui-starling icon indicating copy to clipboard operation
feathersui-starling copied to clipboard

Callout: add optional, separate padding for arrow skins

Open daicemirror opened this issue 9 years ago • 6 comments

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!

daicemirror avatar Jun 03 '16 04:06 daicemirror

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;

daicemirror avatar Jun 03 '16 07:06 daicemirror

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.

joshtynjala avatar Jun 03 '16 16:06 joshtynjala

I see! Thank you.

daicemirror avatar Jun 03 '16 18:06 daicemirror

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!

daicemirror avatar Jun 09 '16 17:06 daicemirror

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.

joshtynjala avatar Jun 09 '16 17:06 joshtynjala

I understand. Thanks for your quick response and friendly admonition.

daicemirror avatar Jun 09 '16 18:06 daicemirror