Skip to content

Instantly share code, notes, and snippets.

@Schepp
Last active October 19, 2015 08:27
Show Gist options
  • Save Schepp/a91f66ad1b0ebda37210 to your computer and use it in GitHub Desktop.
Save Schepp/a91f66ad1b0ebda37210 to your computer and use it in GitHub Desktop.
Suggestions for Simon
  1. use branch "gh-pages", make it default, and delete master. gh-pages' content will automatically be deployed to https://pixolith.github.io/fabricjs-customise-controls-extension/ after push. That way you can have your examples hosted on Github, too.

  2. Nicer API: Combine overwriteActions and setCustomActions into one. As setCustomActions needs overwriteActions anyways and overwriteActions doesn't make sense on its own. -> One call less to write.

  3. Even nicer API: Change setCustomActions to accept an object. That way you can pass one or more pieces of configuration at once, instead of needing to call the method over and over again:

fabric.Canvas.prototype.setCustomActions({
  tl: 'rotate',
  tr: 'scale'
});
  1. Even fucking greater API: Even better, change the thing to just use one single configuration interface for everything:
fabric.Canvas.prototype.customise({
  borderColor: '#000000',
  cornerSize: 34,
  tl: {
    action: 'rotate',
    cursor: 'cow.png'
  },
  tr: {
    action: 'scale',
    cursor: 'sheep.png'
  }
})

(also, alias customise with customizefor our American friends)

  1. Jesus-like API: wrap fabric.Canvas.prototype.customise into some shorthand. Less to type. E.g.:
fabric.prototype.customise = fabric.prototype.customize = fabric.Canvas.prototype.customise;
  1. Use grunt-release to bump and release new versions

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment