renamed tabs; "Click the chart!"

This commit is contained in:
Tim
2024-03-30 00:31:42 -04:00
parent 7f7743445f
commit 391c5738ed
10 changed files with 23 additions and 18 deletions

View File

@@ -111,6 +111,7 @@ export const VerboseCallback = prototype(ShapeCallback, {
onDelete: (shapeId)=>{console.log('onDelete')},
})
let drawingTool = null
export function drawShape(shapeType, ...callbacks) {
// puts the chart into a line-drawing mode for a new shape
@@ -119,6 +120,7 @@ export function drawShape(shapeType, ...callbacks) {
if( co.drawingCallbacks )
invokeCallbacks(co.drawingCallbacks, 'onUndraw')
co.drawingCallbacks = callbacks
drawingTool = null
co.drawing = true
widget.selectLineTool(shapeType.code)
invokeCallbacks(callbacks, 'onDraw')
@@ -162,8 +164,10 @@ const shapeCallbacks = {}
function onSelectedLineToolChanged() {
const tool = widget.selectedLineTool();
// console.log('line tool changed', tool)
if( tool !== 'cursor' ) // 'cursor' cannot be selected manually and only happens just before the 'create' event is issued
console.log('line tool changed', tool)
if (drawingTool===null)
drawingTool = tool
else if (tool!==drawingTool && useChartOrderStore().drawing)
cancelDrawing();
}
@@ -246,7 +250,7 @@ function drawingEventWorker() {
}
function doHandleDrawingEvent(id, event) {
// console.log('drawing event', id, event)
console.log('drawing event', id, event)
const shape = event === 'remove' ? null : chart.getShapeById(id);
if (event === 'create') {
const co = useChartOrderStore();