Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
Fix Lift doesn't account for camera
Browse files Browse the repository at this point in the history
Closes #250
  • Loading branch information
nbilyk committed Feb 11, 2020
1 parent 887fbc4 commit 10909be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acornui-core/src/commonMain/kotlin/com/acornui/popup/Lift.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Lift(owner: Context) : ElementContainerImpl<UiComponent>(owner), LayoutDat
isFocusContainer = true
interactivityMode = InteractivityMode.NONE // The elements are interactive but this Lift component is virtual.

validation.addNode(CONTENTS_TRANSFORM, ValidationFlags.LAYOUT or ValidationFlags.TRANSFORM, ::updateContentsTransform)
validation.addNode(CONTENTS_TRANSFORM, ValidationFlags.LAYOUT or ValidationFlags.TRANSFORM or ValidationFlags.VIEW_PROJECTION, ::updateContentsTransform)

contents.invalidated.add { child, flagsInvalidated ->
if (flagsInvalidated and child.layoutInvalidatingFlags > 0) {
Expand Down Expand Up @@ -118,7 +118,7 @@ class Lift(owner: Context) : ElementContainerImpl<UiComponent>(owner), LayoutDat
private val points = arrayOf(Vector2(0f, 0f), Vector2(1f, 0f), Vector2(1f, 1f), Vector2(0f, 1f))

private fun updateContentsTransform() {
tmpMat.set(transformGlobal)
tmpMat.set(contents.viewProjectionTransformInv).mul(viewProjectionTransform).mul(transformGlobal)
if (constrainToStage) {
val w = window.width
val h = window.height
Expand Down

0 comments on commit 10909be

Please sign in to comment.