Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation not accounted for #107

Open
LRP-sgravel opened this issue Jun 5, 2019 · 2 comments
Open

Rotation not accounted for #107

LRP-sgravel opened this issue Jun 5, 2019 · 2 comments

Comments

@LRP-sgravel
Copy link
Contributor

I'm using the ZoomLayout to display a document. Sometimes this document needs to be rotated because the source document orientation is wrong on the back end. I therefore use the View Rotation property on my FrameLayout container. However, ZoomLayout doesn't account for this when setting it's content size and the zoom/scrolling is therefore off.

I have noticed that ZoomLayout uses the Width and Height on the content directly in it's GlobalLayoutListener. The View's transformation matrix should also be used to get the visible bounds of the content.

@natario1
Copy link
Owner

Yeah, we also don't account for other draw properties like scaleX, scaleY, pivotX, pivotY... But no ViewGroup does this with its children. A better path for this project is to implement rotation inside ZoomEngine, so instead of calling view.setRotation(), you call engine.setRotation(). But that's a long term milestone for now.

Meanwhile I think you should be able to overcome this by wrapping your rotated view inside another layout, and override this layout's onMeasure()

@LRP-sgravel
Copy link
Contributor Author

I overcame this limit by having a container view that is sized according to the rotated document but without any Rotation applied on it, and it’s content uses Rotation and TranslationX/Y to position itself properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants