Skip to content

Commit e9d6f07

Browse files
committed
fix(textAngular): Fix image resize
1 parent 036380b commit e9d6f07

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,11 @@ textAngular.directive("textAngular", [
276276
pos.y = ratio > newRatio ? pos.x * ratio : pos.y;
277277
}
278278
var el = angular.element(_el);
279-
el.css('height', Math.round(Math.max(0, pos.y) + 'px'));
280-
el.css('width', Math.round(Math.max(0, pos.x) + 'px'));
279+
function roundedMaxVal(val) {
280+
return Math.round(Math.max(0, val));
281+
}
282+
el.css('height', roundedMaxVal(pos.y) + 'px');
283+
el.css('width', roundedMaxVal(pos.x) + 'px');
281284

282285
// reflow the popover tooltip
283286
scope.reflowResizeOverlay(_el);

0 commit comments

Comments
 (0)