Skip to content

Commit

Permalink
fix: createShape attribute mode does not take effect.
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Jan 18, 2022
1 parent d6ba080 commit a46d781
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/component/overlay/Shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ export default class Shape extends Overlay {
constructor ({
id, name, totalStep,
chartStore, xAxis, yAxis,
points, styles, lock, data
points, styles, lock, mode, data
}) {
super({ id, chartStore, xAxis, yAxis })
this._name = name
this._totalStep = totalStep
this._lock = lock
this._mode = ShapeMode.NORMAL
this.setMode(mode)
this._data = data
this._drawStep = SHAPE_DRAW_STEP_START
this._points = []
Expand Down
3 changes: 2 additions & 1 deletion src/pane/ChartPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ export default class ChartPane {
*/
createShape (ShapeTemplateClass, shapeOptions, paneId) {
const {
id, points, styles, lock, data,
id, points, styles, lock, mode, data,
onDrawStart, onDrawing,
onDrawEnd, onClick,
onRightClick, onPressedMove,
Expand All @@ -463,6 +463,7 @@ export default class ChartPane {
points,
styles,
lock,
mode,
data
})
if (isFunction(onDrawStart)) {
Expand Down
4 changes: 2 additions & 2 deletions src/store/ShapeStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ export default class ShapeStore {
}
class Template extends Shape {
constructor ({
id, chartStore, xAxis, yAxis, points, styles, lock, data
id, chartStore, xAxis, yAxis, points, styles, lock, mode, data
}) {
super({
id, name, totalStep, chartStore, xAxis, yAxis, points, styles, lock, data
id, name, totalStep, chartStore, xAxis, yAxis, points, styles, lock, mode, data
})
}
}
Expand Down

0 comments on commit a46d781

Please sign in to comment.