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 @@