Skip to content

Commit

Permalink
fix for Sketch 52 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
romannurik committed Sep 20, 2018
1 parent 674cc65 commit 7809548
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ function createContrastReport(context, artboard, {mode = Mode.IMAGE} = {}) {
*/
function renderContrastReportOverlay(metaGroup, {x, y, w, h}, {contrastRatio, note, status}) {
let overlayText = note;
let rectShape = MSRectangleShape.new();
rectShape.frame = MSRect.rectWithRect(NSMakeRect(x, y, w, h));
let fillLayer = MSShapeGroup.shapeWithPath(rectShape);
let fillLayer = MSShapeGroup.shapeWithRect(NSMakeRect(x, y, w, h));
let fill = fillLayer.style().addStylePartOfType(util.StylePartType.FILL);
switch (status) {
case 'pass':
Expand Down Expand Up @@ -320,9 +318,8 @@ function findVisibleTextLayerInfos(parent) {
...findVisibleTextLayerInfos(detachedSymbol)
];
if (bgColor) {
let rectShape = MSRectangleShape.new();
rectShape.frame = frame.copy();
let bgLayer = MSShapeGroup.shapeWithPath(rectShape);
let bgLayer = MSShapeGroup.shapeWithRect(
NSMakeRect(frame.x(), frame.y(), frame.width(), frame.height()));
let fill = bgLayer.style().addStylePartOfType(util.StylePartType.FILL);
fill.color = bgColor;
detachedSymbol.parentGroup().insertLayer_beforeLayer_(bgLayer, detachedSymbol);
Expand Down

0 comments on commit 7809548

Please sign in to comment.