Skip to content

Commit ff5048f

Browse files
committed
【杨琨】【二维绘制前可以修改颜色】
1 parent 2d22cd0 commit ff5048f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/service/2DPlot/Draw/DrawPoint2D.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ export default class DrawPoint2D extends DrawObject {
3636
}
3737

3838
innerOnMouseUp(event) {
39+
let that = this;
3940
const pnt = this.m_coordSys.pointToData([event.pointer.x,event.pointer.y]);
4041

4142
this.m_symbol.getElement().then((element)=>{
43+
const {style} = that.m_symbol;
44+
if(style && style.nodeStyles){
45+
element.initNodeStyles(style.nodeStyles);
46+
}
4247
const object = PlotObjectFactory.createInstance(this.m_symbol.type, {
4348
element:element ,
4449
canvas: this._plotLayer,

src/service/2DPlot/Draw/DrawPolyline2D.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export default class DrawPolyline2D extends DrawObject {
5353

5454
innerOnMouseUp(event) {
5555
if (!this.m_startDrawing) this.m_startDrawing = true;
56+
let that = this;
5657

5758
const pnt = this.m_coordSys.pointToData([event.pointer.x, event.pointer.y]);
5859
const lastPnt = this.m_coords.length > 2 ? this.m_coords[this.m_coords.length - 2] : null;
@@ -69,6 +70,10 @@ export default class DrawPolyline2D extends DrawObject {
6970

7071
if (!this.m_object) {
7172
this.m_symbol.getElement().then((element) => {
73+
const {style} = that.m_symbol;
74+
if(style && style.nodeStyles){
75+
element.initNodeStyles(style.nodeStyles);
76+
}
7277
this.m_object = PlotObjectFactory.createInstance(this.m_symbol.type, {
7378
element: element,
7479
canvas: this._plotLayer

0 commit comments

Comments
 (0)