From f0266f022d16060e198ee4693c72e0869ec4f66a Mon Sep 17 00:00:00 2001 From: scheffle Date: Sat, 23 Mar 2024 00:13:14 +0100 Subject: [PATCH] use "dotted" for kLineOnOffDash --- vstgui/standalone/examples/standalone/resource/test.uidesc | 2 +- vstgui/uidescription-scripting/detail/drawcontextobject.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vstgui/standalone/examples/standalone/resource/test.uidesc b/vstgui/standalone/examples/standalone/resource/test.uidesc index 8f2095940..9612da537 100644 --- a/vstgui/standalone/examples/standalone/resource/test.uidesc +++ b/vstgui/standalone/examples/standalone/resource/test.uidesc @@ -1047,7 +1047,7 @@ "mouse-enabled": "true", "opacity": "1", "origin": "10, 350", - "script": "view.draw = function (context, rect) {\n\tvar polygon = [];\n\tpolygon[0] = {x: 10, y: 0};\n\tpolygon[1] = {x: 0, y: 10};\n\tpolygon[2] = {x: 10, y: 20};\n\tpolygon[3] = {x: 20, y: 10};\n\tpolygon[4] = {x: 10, y: 0};\n\tcontext.setFrameColor (\"red\");\n\tcontext.setFillColor (\"green\");\n\tcontext.drawPolygon (polygon, \"filledAndStroked\");\n\n\tcontext.setFont (\"JSTest\");\n\tcontext.setFontColor (\"black\");\n\tcontext.drawString (\"Hello JavaScript\", view.getBounds (), \"center\");\n\n\tvar clipRect = {left: 5, top: 5, right: 15, bottom: 15};\n\tcontext.setClipRect (clipRect);\n\tcontext.setFillColor (\"cyan\");\n\tcontext.drawRect (view.getBounds (), \"filled\");\n};\n", + "script": "view.draw = function (context, rect) {\n\tvar viewBounds = view.getBounds ();\n\tcontext.saveGlobalState ();\n\tcontext.setLineStyle (\"dotted\");\n\tcontext.setFrameColor (\"navy\");\n\tcontext.setLineWidth (2);\n\tcontext.drawLine ({x: viewBounds.left, y:viewBounds.top}, {x: viewBounds.right, y:viewBounds.bottom});\n\tcontext.restoreGlobalState ();\n\n\tvar polygon = [];\n\tpolygon[0] = {x: 10, y: 0};\n\tpolygon[1] = {x: 0, y: 10};\n\tpolygon[2] = {x: 10, y: 20};\n\tpolygon[3] = {x: 20, y: 10};\n\tpolygon[4] = {x: 10, y: 0};\n\tcontext.setFrameColor (\"red\");\n\tcontext.setFillColor (\"green\");\n\tcontext.drawPolygon (polygon, \"filledAndStroked\");\n\n\tcontext.setFont (\"JSTest\");\n\tcontext.setFontColor (\"black\");\n\tcontext.drawString (\"Hello JavaScript\", viewBounds, \"center\");\n\n\tvar clipRect = {left: 5, top: 5, right: 15, bottom: 15};\n\tcontext.setClipRect (clipRect);\n\tcontext.setFillColor (\"cyan\");\n\tcontext.drawRect (view.getBounds (), \"filled\");\n};\n", "size": "110, 25", "transparent": "false", "wants-focus": "false" diff --git a/vstgui/uidescription-scripting/detail/drawcontextobject.cpp b/vstgui/uidescription-scripting/detail/drawcontextobject.cpp index 1d95bc7c7..c3ab227ee 100644 --- a/vstgui/uidescription-scripting/detail/drawcontextobject.cpp +++ b/vstgui/uidescription-scripting/detail/drawcontextobject.cpp @@ -259,7 +259,7 @@ struct DrawContextObject::Impl { lineStyle = std::make_unique (kLineSolid); } - else if (styleOrLineCap == "onOff"sv) + else if (styleOrLineCap == "dotted"sv) { lineStyle = std::make_unique (kLineOnOffDash); }