Skip to content

Commit

Permalink
Use XCSSMatrix if WebKitCSSMatrix is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Mar 10, 2013
1 parent 8275cbf commit 37df07c
Show file tree
Hide file tree
Showing 2 changed files with 576 additions and 97 deletions.
10 changes: 8 additions & 2 deletions src/UILayer/UILayer.mv
Original file line number Diff line number Diff line change
Expand Up @@ -603,14 +603,20 @@ UILayer.hitTest = ^(x, y) {


# Properties for layers which are texture-backed
if (window.WebKitCSSMatrix) {
CSSMatrix = WebKitCSSMatrix
} else {
import XCSSMatrix/XCSSMatrix
CSSMatrix = XCSSMatrix
}
UILayer.textureBackedProperties = {
matrix: {
get: ^{
@_matrix || (@_matrix = new WebKitCSSMatrix(@element_.style.webkitTransform))
@_matrix || (@_matrix = new CSSMatrix(@element_.style.webkitTransform))
},
set: ^{
M = @_matrix = arguments[0]
if (!M || !(M instanceof WebKitCSSMatrix)) {
if (!M || !(M instanceof CSSMatrix)) {
@_matrix = null
@element_.style.webkitTransform = null
} else {
Expand Down
Loading

0 comments on commit 37df07c

Please sign in to comment.