Skip to content

Commit

Permalink
Use translate3d to get hw-acccerlation on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Photonios authored and Vlad Potra committed Aug 29, 2018
1 parent a2a8283 commit 5204aee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build/image-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ var ImageGallery = function (_React$Component) {
translateX = this._getTranslateXForTwoSlide(index);
}

var translate = 'translate(' + translateX + '%, 0)';
var translate = 'translate3d(' + translateX + '%, 0, 0)';

return {
WebkitTransform: translate,
Expand All @@ -759,9 +759,9 @@ var ImageGallery = function (_React$Component) {
var translate = void 0;

if (this._isThumbnailHorizontal()) {
translate = 'translate(0, ' + this.state.thumbsTranslate + 'px)';
translate = 'translate3d(0, ' + this.state.thumbsTranslate + 'px, 0)';
} else {
translate = 'translate(' + this.state.thumbsTranslate + 'px, 0)';
translate = 'translate3d(' + this.state.thumbsTranslate + 'px, 0, 0)';
}
return {
WebkitTransform: translate,
Expand Down

0 comments on commit 5204aee

Please sign in to comment.