diff --git a/src/charts/chart.js b/src/charts/chart.js
index 209d9ed..cc5a1f1 100644
--- a/src/charts/chart.js
+++ b/src/charts/chart.js
@@ -112,6 +112,7 @@ export const VerboseCallback = prototype(ShapeCallback, {
})
let drawingTool = null
+let previousDrawingTool = null
export function drawShape(shapeType, ...callbacks) {
// puts the chart into a line-drawing mode for a new shape
@@ -121,6 +122,7 @@ export function drawShape(shapeType, ...callbacks) {
invokeCallbacks(co.drawingCallbacks, 'onUndraw')
co.drawingCallbacks = callbacks
drawingTool = null
+ previousDrawingTool = widget.selectedLineTool()
co.drawing = true
widget.selectLineTool(shapeType.code)
invokeCallbacks(callbacks, 'onDraw')
@@ -154,8 +156,9 @@ export function createShape(shapeType, points, options={}, ...callbacks) {
export function cancelDrawing() {
const co = useChartOrderStore()
if (co.drawing) {
- invokeCallbacks(co.drawingCallbacks, 'onUndraw')
co.drawing = false
+ widget.selectLineTool(previousDrawingTool)
+ invokeCallbacks(co.drawingCallbacks, 'onUndraw')
}
}
diff --git a/src/components/chart/LimitBuilder.vue b/src/components/chart/LimitBuilder.vue
index 98e78ea..e35333a 100644
--- a/src/components/chart/LimitBuilder.vue
+++ b/src/components/chart/LimitBuilder.vue
@@ -36,7 +36,7 @@
density="compact" hide-details variant="outlined" label="Skew" step="5"
:color="color" :base-color="color">
-
+
@@ -62,7 +62,7 @@