renamed tabs; "Click the chart!"
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user