Skip to content

Commit

Permalink
[TS] WebKit 602 disappearing graphics bug (#1093)
Browse files Browse the repository at this point in the history
* Added a fix for the iOS 10 issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109

* Renamed uselessFunction and updated documentation
  • Loading branch information
smaren authored and badlogic committed Apr 4, 2018
1 parent 0a61f34 commit c28bbeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spine-ts/core/src/AnimationState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ module spine {
let pose = timelineData[ii] >= AnimationState.FIRST ? MixPose.setup : currentPose;
if (timeline instanceof RotateTimeline) {
this.applyRotateTimeline(timeline, skeleton, animationTime, mix, pose, timelinesRotation, ii << 1, firstFrame);
} else
} else {
// This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109
Utils.webkit602BugfixHelper(mix, pose);
timeline.apply(skeleton, animationLast, animationTime, events, mix, pose, MixDirection.in);
}
}
}
this.queueEvents(current, animationTime);
Expand Down Expand Up @@ -242,6 +245,8 @@ module spine {
if (timeline instanceof RotateTimeline)
this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, pose, timelinesRotation, i << 1, firstFrame);
else {
// This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109
Utils.webkit602BugfixHelper(alpha, pose);
timeline.apply(skeleton, animationLast, animationTime, events, alpha, pose, MixDirection.out);
}
}
Expand Down
5 changes: 5 additions & 0 deletions spine-ts/core/src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ module spine {
static toSinglePrecision (value: number) {
return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;
}

// This function is used to fix WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109
static webkit602BugfixHelper (alpha: number, pose: MixPose) {

}
}

export class DebugUtils {
Expand Down

0 comments on commit c28bbeb

Please sign in to comment.