From c4764c21d8517ab89c28c493e97b88965cea879c Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 1 Jul 2020 16:35:52 -0700 Subject: [PATCH] fix to unblock https://github.com/nim-lang/Nim/pull/14869 --- src/ginger.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ginger.nim b/src/ginger.nim index e6cfc36..0ad82c6 100644 --- a/src/ginger.nim +++ b/src/ginger.nim @@ -14,6 +14,8 @@ export types, backends, macroUtils from os import splitFile +proc byLent[T](a: T): lent T {.inline.} = a # pending https://github.com/nim-lang/Nim/pull/14875 + # TODO: think about renaming `Coord1D` to someting like Unit? # TODO: implement some more units so that we can use it to define @@ -1355,14 +1357,14 @@ func updateDataScale(view: Viewport, obj: var GraphObject) = of goLabel, goText, goTickLabel: view.updateScale(obj.txtPos) of goGrid: - obj.gdXPos.applyIt(view.updateScale(it)) - obj.gdYPos.applyIt(view.updateScale(it)) + obj.gdXPos.applyIt(view.updateScale(it.byLent)) + obj.gdYPos.applyIt(view.updateScale(it.byLent)) of goTick: view.updateScale(obj.tkPos) of goPoint: view.updateScale(obj.ptPos) of goPolyLine: - obj.plPos.applyIt(view.updateScale(it)) + obj.plPos.applyIt(view.updateScale(it.byLent)) of goRect: view.updateScale(obj.reOrigin) of goRaster: