From 22f2e648a26f5599f0696e4d6e0cee728278eec7 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 11 Apr 2025 21:31:04 -0400 Subject: [PATCH] one-time hints; builder touchups --- src/charts/chart.js | 8 +++-- src/components/OneTimeHint.vue | 25 ++++++++-------- src/components/chart/Chart.vue | 13 +------- src/components/chart/ChartOrder.vue | 34 +++++++++++++++++---- src/components/chart/DiagonalBuilder.vue | 2 ++ src/components/chart/LimitBuilder.vue | 4 ++- src/components/chart/RungBuilder.vue | 38 +++++++++++++++++------- src/orderbuild.js | 3 +- 8 files changed, 84 insertions(+), 43 deletions(-) diff --git a/src/charts/chart.js b/src/charts/chart.js index a9d1eb1..c9c86e7 100644 --- a/src/charts/chart.js +++ b/src/charts/chart.js @@ -8,6 +8,7 @@ import {tvCustomThemes} from "../../theme.js"; export let widget = null export let chart = null export let crosshairPoint = null +export let defaultShapeHandler = null // if set, then TV events that dont have a registered shape handler get passed directly to this function let symbolChangedCbs = [] // callbacks for TV's chart.onSymbolChanged() @@ -268,6 +269,7 @@ export function drawShape(shapeType, ...callbacks) { drawingTool = null previousDrawingTool = widget.selectedLineTool() co.drawing = true + co.drew = false widget.selectLineTool(shapeType.code) invokeCallbacks(callbacks, 'onDraw') } @@ -462,9 +464,11 @@ function doHandleDrawingEvent(id, event) { const props = shape.getProperties() if (id in shapeCallbacks) invokeCallbacks(shapeCallbacks[id], 'onProps', id, shape, props) - else - // otherwise it's an event on a shape we don't "own" + else { + // otherwise it's an event on a shape we don't "own" that could be being drawn + co.drew = true console.log('warning: ignoring setProperties on TV shape', id, props) + } } else if (event === 'move') { if (id in shapeCallbacks) { invokeCallbacks(shapeCallbacks[id], 'onMove', id, shape) diff --git a/src/components/OneTimeHint.vue b/src/components/OneTimeHint.vue index 141dd6d..f297b1a 100644 --- a/src/components/OneTimeHint.vue +++ b/src/components/OneTimeHint.vue @@ -1,5 +1,5 @@ diff --git a/src/components/chart/Chart.vue b/src/components/chart/Chart.vue index c9d7417..724f5f6 100644 --- a/src/components/chart/Chart.vue +++ b/src/components/chart/Chart.vue @@ -1,9 +1,8 @@