Skip to content

Instantly share code, notes, and snippets.

@victorpanitz
Created January 28, 2019 10:36
Show Gist options
  • Save victorpanitz/f1f04c1d5ee54c0f53744de3a1c1b8d5 to your computer and use it in GitHub Desktop.
Save victorpanitz/f1f04c1d5ee54c0f53744de3a1c1b8d5 to your computer and use it in GitHub Desktop.
function layer(context, selectedLayer) {
let object = '';
let result = {};
let x = Math.floor(selectedLayer.rect.x);
let y = Math.floor(selectedLayer.rect.y);
let width = Math.floor(selectedLayer.rect.width);
let height = Math.floor(selectedLayer.rect.height);
let rect = "CGRect(x: " + x + ", y: " + y + ", width: " + width + ", height: "+ height + ")";
object += rect;
result = {
code: object,
language: 'swift'
};
return {
code: object,
language: 'swift'
};
}
export default {
layer
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment