layer

Unwanted Vertical Padding from iOS 6 on CATextLayer

北城余情 提交于 2019-12-03 13:50:39
问题 Background: I started my project in iOS 5 and built out a beautiful button with layer. I added a textLayer onto the button and center it using the following code: float textLayerVerticlePadding = ((self.bounds.size.height - fontSize) /2); textLayer = [[CATextLayer alloc]init]; [textLayer setFrame:CGRectOffset(self.bounds, 0, textLayerVerticlePadding)]; It works great and looks dead center until iOS 6. Problem: iOS 6 added a space (padding) between the topmost bound and the text in textLayer.

show/hide layers in d3.js

泪湿孤枕 提交于 2019-12-03 13:17:53
First of all: I'm new to d3.js! I have a map and some points displayed on it. Now I want to add buttons to show/hide the points. What I have until now: function checkAll(){ d3.selectAll("g").attr("visibility", "visible"); } function uncheckAll(){ d3.selectAll("g").attr("visibility", "hidden"); } This works so far but hides/shows the whole map. I have a function "drawpoints()" that draws the points on the map. How can I change my code that it only shows/hides the points and not the whole map? You would need to select only the elements that you want to hide. If, for example, they are identified

How to recognize tap gesture while a view is animating

随声附和 提交于 2019-12-03 13:03:42
Just wondering is there way to have a view recognize tap gestures while it is being animated? I am working on a view that has a cashapelayer line tethered to it. When the user pans the view (pan gesture) the line follows accordingly until the user stops panning. At this point an animation is executed that brings the view back to its original position and the tether layer back as well. Now my only real problem is that while the view and the tether are animating the view doesnt respond to tap gestures… Anyone know some tricks? I hope my explanation was understandable and thanks in advance! (if

Python PSD layers?

♀尐吖头ヾ 提交于 2019-12-03 11:06:11
问题 I need to write a Python program for loading a PSD photoshop image, which has multiple layers and spit out png files (one for each layer). Can you do that in Python? I've tried PIL, but there doesn't seem to be any method for accessing layers. Help. PS. Writing my own PSD loader and png writer has shown to be way too slow. 回答1: Use Gimp-Python? http://www.gimp.org/docs/python/index.html You don't need Photoshop that way, and it should work on any platform that runs Gimp and Python. It's a

Spring, Hibernate, Java EE in the 3 Tier architecture

筅森魡賤 提交于 2019-12-03 10:48:25
问题 I need to get a start as to where I put those technologies in the 3 Tier architecture: This is what I have... presentation layer: HTML, JSP app. layer: Java EE, Spring data access layer: Hibernate, PostgreSQL database 回答1: Yes, I would put Hibernate in the data access layer. In fact the 3rd layer is the "Data layer" and not the data access layer, maybe this confuses you. So everything that's business logic related goes into the app (or business) layer. 回答2: You are mixing Tier and Layer which

Draw from a separate thread with NSOpenGLLayer

帅比萌擦擦* 提交于 2019-12-03 08:48:09
I'm working on an app which needs to draw with OpengGL at a refresh rate at least equal to the refresh rate of the monitor. And I need to perform the drawing in a separate thread so that drawing is never locked by intense UI actions. Actually I'm using a NSOpenGLView in combination with CVDisplayLink and I'm able to achive 60-80FPS without any problem. Since I need also to display some cocoa controls on top of this view I tried to subclass NSOpenGLView and make it layer-backed, following LayerBackedOpenGLView Apple example. The result isn't satisfactory and I get a lot of artifacts. Therefore

call service vs dao from another service

霸气de小男生 提交于 2019-12-03 07:55:19
I have User And Role entities and Service, DAO layers for them. I need Role list from UserService. Which layer should I use from UserService? Call list method of RoleService vs RoleDAO ? Which one is common use and why? Normally DAO layer is close to database, Service layer is encapsulating your business logic, performing any transactions or other things rather than just calling DAO. Service calling another service is more common because Your RoleService can have some business code evaluated, you can benefit from transactions or passing messages via JMS or you can have some security on service

Photoshop scripting: changing text of a text layer

放肆的年华 提交于 2019-12-03 06:24:56
Because I don't have enough time to learn all about PS-Scripting, I was wondering, if you may help me. It's very simple. I want to have a JS-Script, which changes the Text of the Top Layer . For example: The Text is "#005", the script should add 1, so it says "#006". After that, it should export (Save for Web & Devices w. transparency @ 1280x720) the file with the current number (006). Here's a screen of the layers ( omg its in german!!11 ): imageshack.us/photo/my-images/706/helpal.png EDIT for downvoters: Please , for the sake of helping the community and avoiding misleading/wrong information

Trying to delay CABasicAnimation position and opacity of layer by 3 seconds but

Deadly 提交于 2019-12-03 06:12:11
I am trying to delay the animation of layer's opacity and position by 3 seconds using setBeginTime. I have called the layer boxLayer. The animation is going well however during the first 3 seconds (the layer is not supposed to show yet) the layer is displayed at its final position and opacity. It should not. Group animation does not resolve the issue. Could anyone help? See code below: // Create an animation that will change the opacity of a layer CABasicAnimation *fader = [CABasicAnimation animationWithKeyPath:@"opacity"]; // It will last 1 second and will be delayed by 3 seconds [fader

Unwanted Vertical Padding from iOS 6 on CATextLayer

烂漫一生 提交于 2019-12-03 03:50:20
Background: I started my project in iOS 5 and built out a beautiful button with layer. I added a textLayer onto the button and center it using the following code: float textLayerVerticlePadding = ((self.bounds.size.height - fontSize) /2); textLayer = [[CATextLayer alloc]init]; [textLayer setFrame:CGRectOffset(self.bounds, 0, textLayerVerticlePadding)]; It works great and looks dead center until iOS 6. Problem: iOS 6 added a space (padding) between the topmost bound and the text in textLayer. This upsets the calculation above. Is there a way to make sure that iOS 6 does not? because I would