UNPKG

sketch-clean-document

Version:

A Sketch plugin to automagically organise and clean up your Sketch document

11 lines (8 loc) 288 B
import { adjustParentGroupsToFit } from 'sketch-plugin-helper' const keys = ['width', 'height', 'x', 'y'] export default function roundToNearestPixel (layer) { keys.forEach(function (key) { layer.frame[key] = Math.round(layer.frame[key]) adjustParentGroupsToFit(layer) }) }