From f03d8adb70f12c656d08d75f7902c6ddd7b55093 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Thu, 21 Apr 2016 20:13:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=84=D0=B8=D1=87=D0=B0=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D1=81=D0=B2=D0=B5=D1=82=D0=BA=D0=B8=20=D0=BA=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D1=82=D0=BE-=D1=82=D0=BE=D1=87=D0=B5=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/Graph/Graph.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Applications/Graph/Graph.lua b/Applications/Graph/Graph.lua index a1c067a2..54f15545 100644 --- a/Applications/Graph/Graph.lua +++ b/Applications/Graph/Graph.lua @@ -22,6 +22,7 @@ local backgroundColor = 0x1b1b1b local buttonTextColor = 0x1b1b1b local buttonWidth = 20 local selectedPoints = {{x = -5, y = 2}} +local showCornerPoints = false ------------------------------------------------------------------------------------------------------------------------------------------ local buttons = {} @@ -56,7 +57,7 @@ local function drawAxis() end local function limit(n) - if n > -300 and n < 300 then return true end + if n > -500 and n < 500 then return true end end local keyPoints = {} @@ -85,6 +86,7 @@ end local function drawGraph() for i = 1, #keyPoints do doubleHeight.line(xGraph + keyPoints[i].x, yGraph - keyPoints[i].y, xGraph + keyPoints[i].x2, yGraph - keyPoints[i].y2, graphColor) + if showCornerPoints then doubleHeight.set(xGraph + keyPoints[i].x, yGraph - keyPoints[i].y, 0x00A8FF) end end end @@ -166,14 +168,17 @@ while true do {"EmptyLine"}, {"CenterText", ecs.colors.orange, "Параметры рендера"}, {"Slider", 0xFFFFFF, ecs.colors.orange, 1, 100, renderRange, "Диапазон: ", ""}, - {"Slider", 0xFFFFFF, ecs.colors.orange, 1, 100, renderAccuracy * 100, "Точность: ", "/100"}, + {"Slider", 0xFFFFFF, ecs.colors.orange, 1, 100, 101 - renderAccuracy * 100, "Точность: ", ""}, + {"EmptyLine"}, + {"Switch", ecs.colors.orange, 0xffffff, 0xFFFFFF, "Показывать квант-точки", showCornerPoints}, {"EmptyLine"}, {"Button", {ecs.colors.orange, 0xffffff, "OK"}, {0x999999, 0xffffff, "Отмена"}} ) - if data[4] == "OK" then + if data[5] == "OK" then yDependencyString = data[1] renderRange = tonumber(data[2]) - renderAccuracy = tonumber(data[3]) / 100 + renderAccuracy = (101 - tonumber(data[3])) / 100 + showCornerPoints = data[4] calculateKeyPoints() drawAll() end