rotation

QGraphicsView/QGraphicsScene: How to fix an item's X or Y coordinate during rotation?

☆樱花仙子☆ 提交于 2019-12-24 07:38:45
问题 I have about 150 QGraphicsLineItems in a QGraphicsScene, and I want to "rotate" them, but have the rotation not affect their X coordinate. In other words, they would move vertically according to a given rotation angle, but they wouldn't actually rotate or move horizontally. The reason I'd like to do this is that there are several other items in an adjacent QGraphicsScene/View that are rotated normally, and I want the items in this new scene/view to match the displayed height of the normally

Resize rotated object without left top corner shift (sub-pixel rendering issue)

青春壹個敷衍的年華 提交于 2019-12-24 06:48:10
问题 The bounty expires in 6 days . Answers to this question are eligible for a +100 reputation bounty. Vytalyi wants to draw more attention to this question. I'm trying to resize rotated (transformed with css) object with vanilla js. Object origin is center and can't be changed. I've found a function here which should do the thing, however still it doesn't looks ideal - left top corner change its position (half of pixels or so). Here is a simplified codepen example. What code modifications I need

Android: ImageView rotation animation - keep scale type fit center

陌路散爱 提交于 2019-12-24 06:34:21
问题 I have an ImageView that has android:scaleType="fitCenter" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity

UIButton Frame changed After Move from one Position To Another

我的梦境 提交于 2019-12-24 05:20:06
问题 I have 1 UIButton in StoryBoard like below screen and I move UIButton from one position to another position by following this Answer. Edit Another thing that I want to rotate UIButton and for that I have tried below code and it works fine but after rotating UIButton when I try to move UIButton position from 1 place to another then UIButton frame is changed. Entire UIButton code. class DraggableButton: UIButton { var localTouchPosition : CGPoint? var lastRotation: CGFloat = 0 required init?

Android App orientation locked to landscape, locking the device, rotate it to portrait and unlock it, Application crash

本秂侑毒 提交于 2019-12-24 04:42:15
问题 My application is related to Music and I am using Android 4.2.2. I have locked my application to landscape mode by specifying below line in each of my activity: android:screenOrientation="landscape" Now, when I keep my Music application open in landscape mode, lock the screen of the device with the keys, rotate the device in portrait mode and then unlock the screen of the device will cause my Music application throw an Exception. I tried multiple solution like setting the configChanges in my

Resize image and rotate canvas 90 degrees

别说谁变了你拦得住时间么 提交于 2019-12-24 03:43:35
问题 There's quite a few topics here about rotating images with canvas on js. I read most of them, and couldn't figure out a solution for my problem. I'm receiving an image (from an upload component) of whatever resolution. I'm resizing it to 1024x768 like: var canvas = document.createElement('canvas'); var ctx = canvas.getContext("2d"); if (img.width >= img.height) { canvas.width = 1024; canvas.height = 768; } else { canvas.width = 768; canvas.height = 1024; } ctx.drawImage(img, 0, 0, canvas

Resize image and rotate canvas 90 degrees

こ雲淡風輕ζ 提交于 2019-12-24 03:43:23
问题 There's quite a few topics here about rotating images with canvas on js. I read most of them, and couldn't figure out a solution for my problem. I'm receiving an image (from an upload component) of whatever resolution. I'm resizing it to 1024x768 like: var canvas = document.createElement('canvas'); var ctx = canvas.getContext("2d"); if (img.width >= img.height) { canvas.width = 1024; canvas.height = 768; } else { canvas.width = 768; canvas.height = 1024; } ctx.drawImage(img, 0, 0, canvas

Get visible location of SpriteKit node after parent rotation

▼魔方 西西 提交于 2019-12-24 03:12:24
问题 I am using Sprite Kit (uh, perhaps "learning" is more apropos). I have a square game board: +-----+-----+-----+ | 0,2 | 1,2 | 2,2 | +-----+-----+-----+ | 0,1 | 1,1 | 2,1 | +-----+-----+-----+ | 0,0 | 1,0 | 2,0 | +-----+-----+-----+ During testing I am adding a sprite to board position 2,0. I then rotate the board 90 degrees counter-clockwise leaving the sprite - visually - in position 2,2. Of course, since the position of sprites aren't modified by rotation the actual x,y coords don't change.

CSS3 3D Box With Shadows

梦想与她 提交于 2019-12-24 02:48:11
问题 I'm making a notification system. I want this notification to show up like a box that turns, somewhat like some notifications in iOS that the top of the screen rotates like a cube. Now, the front and back of the cube should be transparant/same color as background. When it turns, a shadow should fall over the sides that are not parallel to the front of the viewer, as if there is a lamp shining on the box. Can this be done? To make more clear: Since the front & back of the box are the same as

Direction of rotation or handedness in three.js

依然范特西╮ 提交于 2019-12-24 02:07:07
问题 I've noticed that when I rotate my model around the Z axis, like this: model.rotateZ(rotatedAngle * Math.PI / 180); it seems to rotate counter-clockwise around the axis. Is this observation accurate? Is this documented somewhere? I couldn't find it, perhaps I'm using the wrong search terms. Is this configurable? Most importantly what is the best practice for managing rotations? 回答1: Three.js uses the right handed system and this means counter clockwise is default rotation. See here for all