Skip to content

Commit

Permalink
do not override user options.
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed May 8, 2016
1 parent 13026be commit fcfc9f4
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/shapes/textbox.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,44 @@
* @see {@link fabric.Textbox#initialize} for constructor definition
*/
fabric.Textbox = fabric.util.createClass(fabric.IText, fabric.Observable, {

/**
* Type of an object
* @type String
* @default
*/
type: 'textbox',

/**
* Minimum width of textbox, in pixels.
* @type Number
* @default
*/
minWidth: 20,

/**
* Minimum calculated width of a textbox, in pixels.
* @type Number
* @default
*/
dynamicMinWidth: 0,

/**
* Cached array of text wrapping.
* @type Array
*/
__cachedLines: null,

/**
* Override standard Object class values
*/
lockScalingY: true,

/**
* Override standard Object class values
*/
lockScalingFlip: true,

/**
* Constructor. Some scaling related property values are forced. Visibility
* of controls is also fixed; only the rotation and width controls are
Expand All @@ -50,14 +65,7 @@
*/
initialize: function(text, options) {
this.ctx = fabric.util.createCanvasElement().getContext('2d');

this.callSuper('initialize', text, options);
this.set({
lockUniScaling: false,
lockScalingY: true,
lockScalingFlip: true,
hasBorders: true
});
this.setControlsVisibility(fabric.Textbox.getTextboxControlVisibility());

// add width to this list of props that effect line wrapping.
Expand Down

0 comments on commit fcfc9f4

Please sign in to comment.