diff --git a/app/lib/surface/Camera.coffee b/app/lib/surface/Camera.coffee index 844086066..4a65f52db 100644 --- a/app/lib/surface/Camera.coffee +++ b/app/lib/surface/Camera.coffee @@ -150,12 +150,6 @@ module.exports = class Camera extends CocoClass #zv = Math.min(Math.max(0, worldPos.z - 5), cPos.z - 5) / (cPos.z - 5) #zv * ratioWithY + (1 - zv) * ratioWithoutY - distanceToTopEdge: (y) -> - @worldViewport.y - y - - distanceToRightEdge: (x) -> - (@worldViewport.x + @worldViewport.width) - x - # SUBSCRIPTIONS onZoomIn: (e) -> @zoomTo @target, @zoom * 1.15, 300 diff --git a/app/lib/surface/CoordinateDisplay.coffee b/app/lib/surface/CoordinateDisplay.coffee index 83c7501b5..f650e09b1 100644 --- a/app/lib/surface/CoordinateDisplay.coffee +++ b/app/lib/surface/CoordinateDisplay.coffee @@ -84,7 +84,7 @@ module.exports = class CoordinateDisplay extends createjs.Container totalHeight = contentHeight + contributionsToTotalSize.reduce (a, b) -> a + b if @isNearTopEdge() - verticalEdge = + verticalEdge = startPos: -fullPointMarkerLength posShift: -contentHeight + 4 else @@ -104,10 +104,12 @@ module.exports = class CoordinateDisplay extends createjs.Container @orient verticalEdge, horizontalEdge, totalHeight, totalWidth isNearTopEdge: -> - @camera.distanceToTopEdge(@lastPos.y) <= 1 + yRatio = 1 - (@camera.worldViewport.y - @lastPos.y) / @camera.worldViewport.height + yRatio > 0.9 isNearRightEdge: -> - @camera.distanceToRightEdge(@lastPos.x) <= 4 + xRatio = (@lastPos.x - @camera.worldViewport.x) / @camera.worldViewport.width + xRatio > 0.85 orient: (verticalEdge, horizontalEdge, totalHeight, totalWidth) -> @label.regY = @background.regY = verticalEdge.posShift