提交 0080e7e5 编写于 作者: S serb

8013841: [macosx] Animations not disabled for CALayers used via JAWT

Reviewed-by: anthony, alexsch
上级 6375b793
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -28,6 +28,7 @@
#import "LWCToolkit.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <QuartzCore/CATransaction.h>
@implementation AWTSurfaceLayers
......@@ -74,14 +75,12 @@
}
- (void) setBounds:(CGRect)rect {
layer.anchorPoint = CGPointMake(0, 0);
// translates values to the coordinate system of the "root" layer
CGFloat newY = windowLayer.bounds.size.height - rect.origin.y - rect.size.height;
CGRect newRect = CGRectMake(rect.origin.x, newY, rect.size.width, rect.size.height);
layer.frame = newRect;
rect.origin.y = windowLayer.bounds.size.height - rect.origin.y - rect.size.height;
[CATransaction begin];
[CATransaction setDisableActions:YES];
layer.frame = rect;
[CATransaction commit];
[AWTSurfaceLayers repaintLayersRecursively:layer];
}
......
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -64,11 +64,13 @@ AWT_ASSERT_APPKIT_THREAD;
//Disable CALayer's default animation
NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSNull null], @"anchorPoint",
[NSNull null], @"bounds",
[NSNull null], @"contents",
[NSNull null], @"contentsScale",
[NSNull null], @"onOrderIn",
[NSNull null], @"onOrderOut",
[NSNull null], @"position",
[NSNull null], @"sublayers",
nil];
self.actions = actions;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册