feathersui / feathersui-starling

User interface components for Starling Framework and Adobe AIR
https://feathersui.com/learn/as3-starling/
Other
914 stars 386 forks source link

Scissor rectangle for scrollRect wrong if aspect ratios of stage and viewPort are different #131

Closed joshtynjala closed 12 years ago

joshtynjala commented 12 years ago

contentScaleFactor returns this value: mViewPort.width / mStage.stageWidth

However, the scissor rectangle's y and height need to be scaled by this different value: mViewPort.height / mStage.stageHeight

jamikado commented 12 years ago

Doesn't this also imply a lack of Starling core to represent both a ScaleFactorX and ScaleFactorY too? (along with not scaling textures differently in both dimensions if necessary?)

joshtynjala commented 12 years ago

It would be nice if Starling exposed the Y value too, or at least provided a way for me to get the viewPort without creating a clone of the Rectangle. Even if the direct mViewPort value weren't exposed, then at least it should allow me to pass in my own Rectangle to populate.

Beyond that, I don't really have an opinion because I still don't use this feature.

jamikado commented 12 years ago

Understood, also I think most people, myself included, always set stageWidth/Height and viewport Width/Height to the same ratio, so I would never see different scaleFactors for X and Y. I wouldn't ever want that to happen in my app.