CPViewAnimator: guard in the frame updater function

… in case the transform property value is ‘none’.
This commit is contained in:
cacaodev committed 2017-06-12 12:46:05 +02:00
1 parent 6f1c0fa4a8
commit bb2d860807
1 file changed
+16 -11
+16 -11
View File
@@ -408,20 +408,25 @@ var createUpdateFrame = function(aView, aKeyPath)
{
[aView _setInhibitDOMUpdates:YES];
var matrix = style[transformProperty].split('(')[1].split(')')[0].split(','),
x = ROUND(initialOrigin.x + parseFloat(matrix[4])),
y = ROUND(initialOrigin.y + parseFloat(matrix[5]));
var matrix_value = style[transformProperty];
if (aKeyPath === "frame")
if (matrix_value && matrix_value !== 'none')
{
var width = getCSSPropertyValue("width"),
height = getCSSPropertyValue("height");
var matrix_array = matrix_value.split('(')[1].split(')')[0].split(','),
x = ROUND(initialOrigin.x + parseFloat(matrix_array[4])),
y = ROUND(initialOrigin.y + parseFloat(matrix_array[5]));
[aView setFrame:CGRectMake(x, y, width, height)];
}
else
{
[aView setFrameOrigin:CGPointMake(x, y)];
if (aKeyPath === "frame")
{
var width = getCSSPropertyValue("width"),
height = getCSSPropertyValue("height");
[aView setFrame:CGRectMake(x, y, width, height)];
}
else
{
[aView setFrameOrigin:CGPointMake(x, y)];
}
}
[aView _setInhibitDOMUpdates:NO];