Skip to content

Commit

Permalink
flag增加识别一倍图缩小一倍的能力
Browse files Browse the repository at this point in the history
  • Loading branch information
bugluo committed Sep 20, 2017
1 parent 2834453 commit a015108
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions WeSketch.sketchplugin/Contents/Sketch/flag.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ function getFlag(context, refrush) {
}

var drawLeftArrow = function (doc, dom, isNew) {
var parentArtboard = dom.parentArtboard();
if(parentArtboard != undefined && parentArtboard.rect().size.width < 500){
scale = 1;
}else{
scale = 2;
}
var count;
if (isNew) {
count = getLeftFlagNum();
Expand All @@ -88,8 +94,6 @@ function getFlag(context, refrush) {
count = count - 1;
}
}


var linexl = dom.absoluteRect().x() + dom.rect().size.width;
var liney = dom.absoluteRect().y() + dom.rect().size.height / 2 - (24 * scale / 2);

Expand Down Expand Up @@ -130,6 +134,12 @@ function getFlag(context, refrush) {
return connectionsGroup;
}
var drawRightArrow = function (doc, dom) {
var parentArtboard = dom.parentArtboard();
if(parentArtboard != undefined && parentArtboard.rect().size.width < 500){
scale = 1;
}else{
scale = 2;
}
var count = getRightFlagNum(dom);
if (isDeleteNum != 0 && count > isDeleteNum) {
count = count - 1;
Expand Down Expand Up @@ -313,4 +323,4 @@ function getFlag(context, refrush) {

var onRun = function (context) {
getFlag(context);
}
}

0 comments on commit a015108

Please sign in to comment.