File tree 3 files changed +12
-4
lines changed
examples/feature-examples/src/pages/graph
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ const config: Partial<LogicFlow.Options> = {
22
22
isSilentMode : false ,
23
23
stopScrollGraph : true ,
24
24
stopZoomGraph : true ,
25
+ // textDraggable: true, // TODO: 节点旋转状态下,拖动文本移动是有问题的!!!
26
+ edgeTextDraggable : true ,
25
27
style : {
26
28
rect : {
27
29
rx : 5 ,
Original file line number Diff line number Diff line change @@ -517,14 +517,17 @@ export class BaseEdgeModel<P extends PropertiesType = PropertiesType>
517
517
* 内部方法,处理初始化文本格式
518
518
*/
519
519
@action formatText ( data : EdgeConfig ) {
520
+ const {
521
+ editConfigModel : { edgeTextDraggable, edgeTextEdit } ,
522
+ } = this . graphModel
520
523
const { x, y } = this . textPosition
521
524
const { text } = data
522
525
let textConfig : Required < TextConfig > = {
523
526
value : '' ,
524
527
x,
525
528
y,
526
- draggable : false ,
527
- editable : true ,
529
+ draggable : edgeTextDraggable ,
530
+ editable : edgeTextEdit ,
528
531
}
529
532
530
533
if ( text ) {
Original file line number Diff line number Diff line change @@ -246,13 +246,16 @@ export class BaseNodeModel<P extends PropertiesType = PropertiesType>
246
246
* 始化文本属性
247
247
*/
248
248
private formatText ( data : NodeConfig ) : void {
249
+ const {
250
+ editConfigModel : { nodeTextDraggable, nodeTextEdit } ,
251
+ } = this . graphModel
249
252
const { x, y, text } = data
250
253
let textConfig : TextConfig = {
251
254
value : '' ,
252
255
x,
253
256
y,
254
- draggable : false ,
255
- editable : true ,
257
+ draggable : nodeTextDraggable ,
258
+ editable : nodeTextEdit ,
256
259
}
257
260
if ( text ) {
258
261
if ( typeof text === 'string' ) {
You can’t perform that action at this time.
0 commit comments