/** * Created by guopeng on 16/8/3. */ import * as React from "react"; import GraphicDesigner from "../../design/designer/GraphicDesigner"; import {RectF, SizeF} from "../../drawing/Unit"; import {KonvaMapping} from "../../drawing/KonvaMapping"; import {RectObjectPool} from "../../drawing/KonvaObjectPools"; import RectangleItem from "../../items/RectangleItem"; export default class RectangleDesigner extends GraphicDesigner { render(bounds: RectF): any { const width = bounds.width; const height = bounds.height; const item = this.item as RectangleItem; const props = { x:bounds.x, y:bounds.y, width: width, height: height, fill: item.fill, stroke: item.style.strokeColor, strokeWidth: item.style.strokeWidth.value, dash: KonvaMapping.getLineStyleValue(item.style.strokeStyle), cornerRadius : item.style.radius }; return RectObjectPool.get(props); } }