|
@@ -11,12 +11,12 @@
|
|
|
|
|
|
class roundRect extends SGraphShape {
|
|
class roundRect extends SGraphShape {
|
|
constructor(parent, data) {
|
|
constructor(parent, data) {
|
|
- super(parent, data.Style)
|
|
|
|
- this.leftTopX = data.X
|
|
|
|
- this.leftTopY = data.Y
|
|
|
|
- this.width = data.Width
|
|
|
|
- this.height = data.Height
|
|
|
|
- this.radius = data.Radius
|
|
|
|
|
|
+ super(parent, data.Style);
|
|
|
|
+ this.leftTopX = data.X;
|
|
|
|
+ this.leftTopY = data.Y;
|
|
|
|
+ this.width = data.Width;
|
|
|
|
+ this.height = data.Height;
|
|
|
|
+ this.radius = data.Radius;
|
|
}
|
|
}
|
|
|
|
|
|
boundingRect() {
|
|
boundingRect() {
|
|
@@ -97,19 +97,19 @@
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
init() {
|
|
init() {
|
|
- this.view = new SGraphView('roundRect')
|
|
|
|
- const scene = new SGraphScene()
|
|
|
|
|
|
+ this.view = new SGraphView('roundRect');
|
|
|
|
+ const scene = new SGraphScene();
|
|
|
|
|
|
- this.item = new roundRect(null, this.rectData)
|
|
|
|
- this.item.selectable = true
|
|
|
|
- scene.addItem(this.item)
|
|
|
|
|
|
+ this.item = new roundRect(null, this.rectData);
|
|
|
|
+ this.item.selectable = true;
|
|
|
|
+ scene.addItem(this.item);
|
|
|
|
|
|
- this.item2 = new roundRect(null, this.rectData2)
|
|
|
|
- this.item2.selectable = true
|
|
|
|
- scene.addItem(this.item2)
|
|
|
|
|
|
+ this.item2 = new roundRect(null, this.rectData2);
|
|
|
|
+ this.item2.selectable = true;
|
|
|
|
+ scene.addItem(this.item2);
|
|
|
|
|
|
- this.view.scene = scene
|
|
|
|
- this.view.fitSceneToView()
|
|
|
|
|
|
+ this.view.scene = scene;
|
|
|
|
+ this.view.fitSceneToView();
|
|
this.view.scalable = false
|
|
this.view.scalable = false
|
|
},
|
|
},
|
|
changeEnable() {
|
|
changeEnable() {
|
|
@@ -124,4 +124,4 @@
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
|
|
|
-</style>
|
|
|
|
|
|
+</style>
|