徐振升
4 years ago
2 changed files with 51 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||||||
|
import { AxRectangleShape } from "./axRectangleShape"; |
||||||
|
|
||||||
|
export class AxImageShapeTest extends AxRectangleShape{ |
||||||
|
/** |
||||||
|
*
|
||||||
|
*/ |
||||||
|
constructor(x:number,y:number,width:number,height:number) { |
||||||
|
super(x,y,width,height); |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
/** |
||||||
|
* Copyright (c) 2006-2015, JGraph Ltd |
||||||
|
* Copyright (c) 2006-2015, Gaudenz Alder |
||||||
|
*/ |
||||||
|
import { Graphics } from "pixi.js"; |
||||||
|
/** |
||||||
|
* Class: mxRectangleShape |
||||||
|
* |
||||||
|
* Extends <mxShape> to implement a rectangle shape. |
||||||
|
* This shape is registered under <mxConstants.SHAPE_RECTANGLE> |
||||||
|
* in <mxCellRenderer>. |
||||||
|
*
|
||||||
|
* Constructor: mxRectangleShape |
||||||
|
* |
||||||
|
* Constructs a new rectangle shape. |
||||||
|
*
|
||||||
|
* Parameters: |
||||||
|
*
|
||||||
|
* bounds - <mxRectangle> that defines the bounds. This is stored in |
||||||
|
* <mxShape.bounds>. |
||||||
|
* fill - String that defines the fill color. This is stored in <fill>. |
||||||
|
* stroke - String that defines the stroke color. This is stored in <stroke>. |
||||||
|
* strokewidth - Optional integer that defines the stroke width. Default is |
||||||
|
* 1. This is stored in <strokewidth>. |
||||||
|
*/ |
||||||
|
export class AxRectangleShape extends Graphics{ |
||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
constructor(x:number,y:number,width:number,height:number) { |
||||||
|
super(); |
||||||
|
this.beginFill(0x0000ff,0); |
||||||
|
this.lineStyle(1, 0xff0000,0); |
||||||
|
this.drawRect(x, y, width, height); |
||||||
|
this.endFill(); |
||||||
|
console.log(this.getLocalBounds()); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue