Skip to content

Commit

Permalink
fix(textAngular): Use CSS instead of html attributes to resize image.
Browse files Browse the repository at this point in the history
Fix image size generated with popover buttons and resize handle.
Because mixing popover size buttons and resize handle can create
some funky image sizes because of width and height html attributes
is mixed with CSS width and height.
  • Loading branch information
Nick Nissen committed Jul 8, 2015
1 parent 56e90a9 commit a84f6df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ textAngular.directive("textAngular", [
pos.y = ratio > newRatio ? pos.x * ratio : pos.y;
}
var el = angular.element(_el);
el.attr('height', Math.max(0, pos.y));
el.attr('width', Math.max(0, pos.x));
el.css('height', Math.round(Math.max(0, pos.y)));
el.css('width', Math.round(Math.max(0, pos.x)));

// reflow the popover tooltip
scope.reflowResizeOverlay(_el);
Expand Down

0 comments on commit a84f6df

Please sign in to comment.