Skip to content
Snippets Groups Projects
Commit c52e6788 authored by Timur Pocheptsov's avatar Timur Pocheptsov
Browse files

Disable quartz shadows - even GUI is jerky because of them (picker views, animations etc.)

git-svn-id: http://root.cern.ch/svn/root/trunk@43488 27541ba8-7e3a-0410-8455-c3a389f83636
parent 044b424a
Branches
Tags
No related merge requests found
...@@ -159,12 +159,12 @@ void Painter::SetStrokeParameters()const ...@@ -159,12 +159,12 @@ void Painter::SetStrokeParameters()const
CGContextSetLineWidth(fCtx, 5.f); CGContextSetLineWidth(fCtx, 5.f);
return; return;
} }
*/
if (fPainterMode == kPaintShadow) { if (fPainterMode == kPaintShadow) {
CGContextSetRGBStrokeColor(fCtx, shadowColor[0], shadowColor[1], shadowColor[2], shadowColor[3]); CGContextSetRGBStrokeColor(fCtx, shadowColor[0], shadowColor[1], shadowColor[2], shadowColor[3]);
CGContextSetLineWidth(fCtx, 5.f); CGContextSetLineWidth(fCtx, 5.f);
return; return;
}*/ }
if (gVirtualX->GetLineWidth() > 1.f) if (gVirtualX->GetLineWidth() > 1.f)
CGContextSetLineWidth(fCtx, gVirtualX->GetLineWidth()); CGContextSetLineWidth(fCtx, gVirtualX->GetLineWidth());
...@@ -231,12 +231,14 @@ void Painter::SetPolygonParameters()const ...@@ -231,12 +231,14 @@ void Painter::SetPolygonParameters()const
CGContextSetRGBFillColor(fCtx, pinkColor[0], pinkColor[1], pinkColor[2], pinkColor[3]); CGContextSetRGBFillColor(fCtx, pinkColor[0], pinkColor[1], pinkColor[2], pinkColor[3]);
return; return;
} }
*/
if (fPainterMode == kPaintShadow) { if (fPainterMode == kPaintShadow) {
// SetStrokeParameters(); // SetStrokeParameters();
CGContextSetRGBFillColor(fCtx, shadowColor[0], shadowColor[1], shadowColor[2], shadowColor[3]); CGContextSetRGBFillColor(fCtx, shadowColor[0], shadowColor[1], shadowColor[2], shadowColor[3]);
CGContextSetRGBStrokeColor(fCtx, shadowColor[0], shadowColor[1], shadowColor[2], shadowColor[3]);
return; return;
}*/ }
const Float_t alpha = 1.f;//must be in gVirtualX. const Float_t alpha = 1.f;//must be in gVirtualX.
Float_t red = 1.f, green = 1.f, blue = 1.f;//White by default. Float_t red = 1.f, green = 1.f, blue = 1.f;//White by default.
...@@ -443,7 +445,7 @@ void Painter::SetMarkerColor()const ...@@ -443,7 +445,7 @@ void Painter::SetMarkerColor()const
SetMarkerFillColor(fCtx, gVirtualX->GetMarkerColor()); SetMarkerFillColor(fCtx, gVirtualX->GetMarkerColor());
} else if (fPainterMode == kPaintShadow) { } else if (fPainterMode == kPaintShadow) {
CGContextSetRGBFillColor(fCtx, shadowColor[0], shadowColor[1], shadowColor[2], shadowColor[3]); CGContextSetRGBFillColor(fCtx, shadowColor[0], shadowColor[1], shadowColor[2], shadowColor[3]);
}/* else if (fPainterMode == kPaintSelected) { } /*else if (fPainterMode == kPaintSelected) {
CGContextSetRGBFillColor(fCtx, pinkColor[0], pinkColor[1], pinkColor[2], pinkColor[3]); CGContextSetRGBFillColor(fCtx, pinkColor[0], pinkColor[1], pinkColor[2], pinkColor[3]);
}*/ }*/
} else { } else {
...@@ -452,10 +454,10 @@ void Painter::SetMarkerColor()const ...@@ -452,10 +454,10 @@ void Painter::SetMarkerColor()const
} else if (fPainterMode == kPaintShadow) { } else if (fPainterMode == kPaintShadow) {
CGContextSetRGBStrokeColor(fCtx, shadowColor[0], shadowColor[1], shadowColor[2], shadowColor[3]); CGContextSetRGBStrokeColor(fCtx, shadowColor[0], shadowColor[1], shadowColor[2], shadowColor[3]);
CGContextSetLineWidth(fCtx, 5.f); CGContextSetLineWidth(fCtx, 5.f);
} /*else if (fPainterMode == kPaintSelected) { }/* else if (fPainterMode == kPaintSelected) {
CGContextSetRGBStrokeColor(fCtx, pinkColor[0], pinkColor[1], pinkColor[2], pinkColor[3]); CGContextSetRGBStrokeColor(fCtx, pinkColor[0], pinkColor[1], pinkColor[2], pinkColor[3]);
CGContextSetLineWidth(fCtx, 5.f); CGContextSetLineWidth(fCtx, 5.f);
} */ }*/
} }
} }
......
...@@ -137,6 +137,7 @@ const CGFloat markerPos = 100.f; ...@@ -137,6 +137,7 @@ const CGFloat markerPos = 100.f;
[self notify]; [self notify];
} }
//____________________________________________________________________________________________________
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{ {
if (!decelerate) { if (!decelerate) {
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10"> <archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
<data> <data>
<int key="IBDocument.SystemTarget">1280</int> <int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">11C74</string> <string key="IBDocument.SystemVersion">11D50b</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string> <string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.23</string> <string key="IBDocument.AppKitVersion">1138.32</string>
<string key="IBDocument.HIToolboxVersion">567.00</string> <string key="IBDocument.HIToolboxVersion">568.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string> <string key="NS.object.0">1179</string>
</object> </object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies"> <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
<int key="NSvFlags">292</int> <int key="NSvFlags">292</int>
<string key="NSFrame">{{15, 190}, {40, 70}}</string> <string key="NSFrame">{{15, 190}, {40, 70}}</string>
<reference key="NSSuperview" ref="985740265"/> <reference key="NSSuperview" ref="985740265"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="522099918"/> <reference key="NSNextKeyView" ref="522099918"/>
<string key="NSReuseIdentifierKey">_NS:241</string> <string key="NSReuseIdentifierKey">_NS:241</string>
<bool key="IBUIOpaque">NO</bool> <bool key="IBUIOpaque">NO</bool>
...@@ -82,6 +83,7 @@ ...@@ -82,6 +83,7 @@
<int key="NSvFlags">292</int> <int key="NSvFlags">292</int>
<string key="NSFrame">{{195, 190}, {40, 70}}</string> <string key="NSFrame">{{195, 190}, {40, 70}}</string>
<reference key="NSSuperview" ref="985740265"/> <reference key="NSSuperview" ref="985740265"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:241</string> <string key="NSReuseIdentifierKey">_NS:241</string>
<bool key="IBUIOpaque">NO</bool> <bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string> <string key="targetRuntimeIdentifier">IBIPadFramework</string>
...@@ -106,6 +108,7 @@ ...@@ -106,6 +108,7 @@
<int key="NSvFlags">292</int> <int key="NSvFlags">292</int>
<string key="NSFrame">{{55, 190}, {140, 70}}</string> <string key="NSFrame">{{55, 190}, {140, 70}}</string>
<reference key="NSSuperview" ref="985740265"/> <reference key="NSSuperview" ref="985740265"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="155047516"/> <reference key="NSNextKeyView" ref="155047516"/>
<string key="NSReuseIdentifierKey">_NS:212</string> <string key="NSReuseIdentifierKey">_NS:212</string>
<reference key="IBUIBackgroundColor" ref="586102906"/> <reference key="IBUIBackgroundColor" ref="586102906"/>
...@@ -114,6 +117,7 @@ ...@@ -114,6 +117,7 @@
</object> </object>
<string key="NSFrameSize">{250, 280}</string> <string key="NSFrameSize">{250, 280}</string>
<reference key="NSSuperview"/> <reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="472788398"/> <reference key="NSNextKeyView" ref="472788398"/>
<string key="NSReuseIdentifierKey">_NS:195</string> <string key="NSReuseIdentifierKey">_NS:195</string>
<object class="NSColor" key="IBUIBackgroundColor"> <object class="NSColor" key="IBUIBackgroundColor">
...@@ -225,7 +229,7 @@ ...@@ -225,7 +229,7 @@
<string>19.IBPluginDependency</string> <string>19.IBPluginDependency</string>
<string>4.IBPluginDependency</string> <string>4.IBPluginDependency</string>
</object> </object>
<object class="NSMutableArray" key="dict.values"> <object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<string>LineInspector</string> <string>LineInspector</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
...@@ -252,9 +256,76 @@ ...@@ -252,9 +256,76 @@
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">22</int> <int key="maxID">22</int>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"/> <object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">LineInspector</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>decLineWidth</string>
<string>incLineWidth</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>decLineWidth</string>
<string>incLineWidth</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBActionInfo">
<string key="name">decLineWidth</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">incLineWidth</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">lineWidthPicker</string>
<string key="NS.object.0">LineWidthPicker</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">lineWidthPicker</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">lineWidthPicker</string>
<string key="candidateClassName">LineWidthPicker</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/LineInspector.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">LineWidthPicker</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/LineWidthPicker.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int> <int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string> <string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1296" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/> <integer value="3100" key="NS.object.0"/>
...@@ -268,12 +339,12 @@ ...@@ -268,12 +339,12 @@
<string>dec_line_width.png</string> <string>dec_line_width.png</string>
<string>inc_line_width.png</string> <string>inc_line_width.png</string>
</object> </object>
<object class="NSMutableArray" key="dict.values"> <object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<string>{40, 70}</string> <string>{40, 70}</string>
<string>{40, 70}</string> <string>{40, 70}</string>
</object> </object>
</object> </object>
<string key="IBCocoaTouchPluginVersion">933</string> <string key="IBCocoaTouchPluginVersion">1179</string>
</data> </data>
</archive> </archive>
...@@ -324,18 +324,12 @@ enum Mode { ...@@ -324,18 +324,12 @@ enum Mode {
- (void)willAnimateRotationToInterfaceOrientation : (UIInterfaceOrientation)interfaceOrientation duration : (NSTimeInterval) duration - (void)willAnimateRotationToInterfaceOrientation : (UIInterfaceOrientation)interfaceOrientation duration : (NSTimeInterval) duration
{ {
[self correctFramesForOrientation : interfaceOrientation]; [self correctFramesForOrientation : interfaceOrientation];
//Let's hide shadow during rotation.
if (!editablePadView.isHidden && !editablePadView.selectionView.isHidden)
editablePadView.selectionView.layer.shadowOpacity = 0.f;
} }
//____________________________________________________________________________________________________ //____________________________________________________________________________________________________
- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation - (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{ {
//Now, after rotation is finished we can show the shadow again. //Now, after rotation is finished we can show the shadow again.
if (!editablePadView.isHidden && !editablePadView.selectionView.isHidden)
editablePadView.selectionView.layer.shadowOpacity = [SelectionView shadowOpacity];
} }
//____________________________________________________________________________________________________ //____________________________________________________________________________________________________
......
...@@ -21,7 +21,7 @@ const CGRect selectionHintFrame = CGRectMake(0.f, 0.f, 250.f, 300.f); ...@@ -21,7 +21,7 @@ const CGRect selectionHintFrame = CGRectMake(0.f, 0.f, 250.f, 300.f);
//____________________________________________________________________________________________________ //____________________________________________________________________________________________________
+ (CGFloat) shadowOpacity + (CGFloat) shadowOpacity
{ {
return 0.8; return 0.;
} }
//____________________________________________________________________________________________________ //____________________________________________________________________________________________________
...@@ -32,10 +32,6 @@ const CGRect selectionHintFrame = CGRectMake(0.f, 0.f, 250.f, 300.f); ...@@ -32,10 +32,6 @@ const CGRect selectionHintFrame = CGRectMake(0.f, 0.f, 250.f, 300.f);
if (self) { if (self) {
pad = p; pad = p;
self.opaque = NO; self.opaque = NO;
self.layer.shadowColor = [UIColor blackColor].CGColor;
self.layer.shadowOpacity = [SelectionView shadowOpacity];
self.layer.shadowOffset = CGSizeMake(5.f, 5.f);
} }
return self; return self;
...@@ -56,6 +52,9 @@ const CGRect selectionHintFrame = CGRectMake(0.f, 0.f, 250.f, 300.f); ...@@ -56,6 +52,9 @@ const CGRect selectionHintFrame = CGRectMake(0.f, 0.f, 250.f, 300.f);
pad->SetViewWH(rect.size.width, rect.size.height); pad->SetViewWH(rect.size.width, rect.size.height);
pad->SetContext(ctx); pad->SetContext(ctx);
CGContextTranslateCTM(ctx, 2.5f, 2.5f);
pad->PaintShadowForSelected();
CGContextTranslateCTM(ctx, -2.5f, -2.5f);
pad->PaintSelected(); pad->PaintSelected();
CGContextRestoreGState(ctx); CGContextRestoreGState(ctx);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment