From 89495d96a6bf39cf673e59640e3cc77d2b469e1b Mon Sep 17 00:00:00 2001 From: lxsang Date: Mon, 6 May 2019 17:51:57 +0200 Subject: [PATCH] fix axist upside down --- LuaPlayground/build/debug/main.js | 5 ++--- LuaPlayground/coffees/main.coffee | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/LuaPlayground/build/debug/main.js b/LuaPlayground/build/debug/main.js index d3958f2..f057151 100644 --- a/LuaPlayground/build/debug/main.js +++ b/LuaPlayground/build/debug/main.js @@ -12,7 +12,7 @@ } canvasPoint(v) { - return new paper.Point(v[0] / this.target.resolution + this.base.x, v[1] / this.target.resolution + this.base.y); + return new paper.Point(v[0] / this.target.resolution + this.base.x, -v[1] / this.target.resolution + this.base.y); } getBound() { @@ -47,7 +47,7 @@ this.bound = [peak_tl, peak_rb]; this.base = { x: 0 - this.bound[0].x + this.offset, - y: 0 - this.bound[0].y + this.offset + y: this.bound[1].y + this.offset }; this.width = peak_rb.x - peak_tl.x + 2 * this.offset; return this.height = peak_rb.y - peak_tl.y + 2 * this.offset; @@ -215,7 +215,6 @@ if (!(obj && obj.type && this[obj.type])) { return false; } - console.log("rendering object"); el = this[obj.type](obj).el; p = ($("

")).attr("class", "info")[0]; $(p).append(el); diff --git a/LuaPlayground/coffees/main.coffee b/LuaPlayground/coffees/main.coffee index 2f6b403..2fcca83 100644 --- a/LuaPlayground/coffees/main.coffee +++ b/LuaPlayground/coffees/main.coffee @@ -8,7 +8,7 @@ class DataViewer @render() canvasPoint: (v) -> - return new paper.Point(v[0] / @target.resolution + @base.x, v[1] / @target.resolution + @base.y) + return new paper.Point(v[0] / @target.resolution + @base.x, - v[1] / @target.resolution + @base.y) getBound: () -> peak_tl = { x:0, y:0} @@ -23,7 +23,7 @@ class DataViewer peak_rb.y = y if y > peak_rb.y @bound = [ peak_tl, peak_rb ] - @base = {x: 0 - @bound[0].x + @offset, y: 0- @bound[0].y + @offset} + @base = {x: 0 - @bound[0].x+ @offset, y: @bound[1].y + @offset} @width = peak_rb.x - peak_tl.x + 2*@offset @height = peak_rb.y - peak_tl.y + 2*@offset prepare: () ->