1.7.6
http://jsfiddle.net/fabricjs/Da7SP/
Here is a solution that I implemented -
var TextboxWithPadding = fabric.util.createClass(fabric.Textbox, {
_renderBackground: function(ctx) {
if (!this.backgroundColor) {
return;
}
var dim = this._getNonTransformedDimensions();
ctx.fillStyle = this.backgroundColor;
ctx.fillRect(
-dim.x / 2 - this.padding,
-dim.y / 2 - this.padding,
dim.x + this.padding * 2,
dim.y + this.padding * 2
);
// if there is background color no other shadows
// should be casted
this._removeShadow(ctx);
}
});
this.left and this.top will also have to be taken into account.
But with new fabric updates, this method will have to be synced with that of fabric.object.
@brijeshb42 I've been researching on this for a few days... your solution really helps me a lot...!
Thanks so much ... you are the best ...!
Most helpful comment
Here is a solution that I implemented -
this.leftandthis.topwill also have to be taken into account.But with new fabric updates, this method will have to be synced with that of
fabric.object.