Skip to content

Instantly share code, notes, and snippets.

@howtomakeaturn
howtomakeaturn / gist:4855a886363085d3067f2f3cbbf36c72
Last active March 22, 2022 07:34
fabricjs-TextboxWithPadding.md

create the new type

fabric.TextboxWithPadding = fabric.util.createClass(fabric.Textbox, {
  type: 'textboxwithpadding',

  toObject: function() {
    return fabric.util.object.extend(this.callSuper('toObject'), {
      backgroundColor: this.get('backgroundColor'),
      padding: this.get('padding'),