Skip to content

Commit

Permalink
Update viewport transform via style atribute. Close #195 and close #101
Browse files Browse the repository at this point in the history
  • Loading branch information
bumbu committed Apr 24, 2016
1 parent 004b287 commit e1239d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/svg-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ module.exports = {
, s = 'matrix(' + matrix.a + ',' + matrix.b + ',' + matrix.c + ',' + matrix.d + ',' + matrix.e + ',' + matrix.f + ')';

element.setAttributeNS(null, 'transform', s);
if ('transform' in element.style) {
element.style.transform = s;
} else if ('-ms-transform' in element.style) {
element.style['-ms-transform'] = s;
} else if ('-webkit-transform' in element.style) {
element.style['-webkit-transform'] = s;
}

// IE has a bug that makes markers disappear on zoom (when the matrix "a" and/or "d" elements change)
// see http://stackoverflow.com/questions/17654578/svg-marker-does-not-work-in-ie9-10
Expand Down

4 comments on commit e1239d4

@mparpaillon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bumbu You forgot to remove line 151. The attribute is still set here

@bumbu
Copy link
Owner Author

@bumbu bumbu commented on e1239d4 Apr 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upsss, true that

@bumbu
Copy link
Owner Author

@bumbu bumbu commented on e1239d4 Apr 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now

@ttupper92618
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have not tried this, but maybe use translate3d for webkit in order to force hardware acceleration:

Relates to #224

Please sign in to comment.