Skip to content

Commit

Permalink
fix(textAngular): Fix image resize
Browse files Browse the repository at this point in the history
  • Loading branch information
nickknissen committed Aug 7, 2015
1 parent 036380b commit e9d6f07
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main.js
Expand Up @@ -276,8 +276,11 @@ textAngular.directive("textAngular", [
pos.y = ratio > newRatio ? pos.x * ratio : pos.y;
}
var el = angular.element(_el);
el.css('height', Math.round(Math.max(0, pos.y) + 'px'));
el.css('width', Math.round(Math.max(0, pos.x) + 'px'));
function roundedMaxVal(val) {
return Math.round(Math.max(0, val));
}
el.css('height', roundedMaxVal(pos.y) + 'px');
el.css('width', roundedMaxVal(pos.x) + 'px');

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

0 comments on commit e9d6f07

Please sign in to comment.