one-time hints; builder touchups

This commit is contained in:
tim
2025-04-11 21:31:04 -04:00
parent 7973a1e8b7
commit 22f2e648a2
8 changed files with 84 additions and 43 deletions

View File

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