Bug Fixed

This commit is contained in:
Luis Fernando Molina committed 2020-03-01 12:48:26 +01:00
1 parent 89fe5bc73d
commit c30199ca48
1 file changed
+16
+16
View File
@@ -252,10 +252,26 @@ function newFloatingSpace () {
function physics () {
if (visible === true) {
browserZoomPhysics()
positionContraintsPhysics()
thisObject.floatingLayer.physics()
}
}
function positionContraintsPhysics () {
if (thisObject.container.frame.position.x > 0) {
thisObject.container.frame.position.x = 0
}
if (thisObject.container.frame.position.y > 0) {
thisObject.container.frame.position.y = 0
}
if (thisObject.container.frame.position.x + thisObject.container.frame.width < browserCanvas.width) {
thisObject.container.frame.position.x = browserCanvas.width - thisObject.container.frame.width
}
if (thisObject.container.frame.position.y + thisObject.container.frame.height < browserCanvas.height) {
thisObject.container.frame.position.y = browserCanvas.height - thisObject.container.frame.height
}
}
function browserZoomPhysics () {
if (devicePixelRatio !== window.devicePixelRatio) {
devicePixelRatio = window.devicePixelRatio