From 841e2b4c79f0131ff10d6ff52c55cd643a385f93 Mon Sep 17 00:00:00 2001 From: zhandouxiaojiji Date: Tue, 20 Oct 2020 20:42:40 +0800 Subject: [PATCH] add drag shape --- render-process/index.tsx | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/render-process/index.tsx b/render-process/index.tsx index 0d6ed55..1fba085 100644 --- a/render-process/index.tsx +++ b/render-process/index.tsx @@ -98,6 +98,48 @@ export default class Main extends Component { }, name: 'title', }); + + group.addShape('rect', { + name: 'drag-up', + attrs: { + x: -w / 2, + y: -h / 2, + width: w * 0.6, + height: h / 2, + fill: 'blue', + fillOpacity: 0.5, + radius: r, + }, + visible: false, + }); + + group.addShape('rect', { + name: 'drag-down', + attrs: { + x: -w / 2, + y: 0, + width: w * 0.6, + height: h / 2, + fill: 'green', + fillOpacity: 0.5, + radius: r, + }, + visible: false, + }); + + group.addShape('rect', { + name: 'drag-right', + attrs: { + x: w * 0.1, + y: -h / 2, + width: w * 0.4, + height: h, + fill: 'yellow', + fillOpacity: 0.5, + radius: r, + }, + visible: false, + }); return shape; },