transform

How to get CSS transform rotation value in degrees with JavaScript

两盒软妹~` 提交于 2019-12-23 08:39:57
问题 I'm using the code found at CSS-Tricks to get the current rotation transform (in CSS) with JavaScript. JavaScript function: function getCurrentRotation( elid ) { var el = document.getElementById(elid); var st = window.getComputedStyle(el, null); var tr = st.getPropertyValue("-webkit-transform") || st.getPropertyValue("-moz-transform") || st.getPropertyValue("-ms-transform") || st.getPropertyValue("-o-transform") || st.getPropertyValue("transform") || "fail..."; if( tr !== "none") { console

When are Schwartzian Transforms useful?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 07:56:17
问题 While going through the "Intermediate Perl" book I noticed a section on Schwartzian Transforms and tried the example in the exercise (9.9.2) but noticed that multiple runs resulted in the transform taking more time then the normal sort. The code here performs a simple sort of the files in the windows\system32 directory based on file size - #!/usr/bin/perl use strict; use warnings; use Benchmark; my $time = timethese( 10, { testA => sub { map $_->[0], sort {$a->[1] <=> $b->[1]} map [$_, -s $_]

CSS: Wrong position of “transform: scale();” container children

不羁岁月 提交于 2019-12-23 06:54:53
问题 I have a container element with long content which is scaled: .container { transform: scale(0.9); } inside this container I have a child div which is used to be a popup. It's positioned absolute with top 50% .popup { width: 300px; height: 200px; position: absolute; left: 50%; top: 50%; } but unfortunately when container is scaled this 50% is not working. I need to use ~240% if it appears on the bottom of a page. Do you now some specifics on applying positioning on children of scaled elements?

Percentage transform-origin for SVG not obeyed in Firefox, only sometimes in WebKit

旧时模样 提交于 2019-12-23 06:47:18
问题 I have this ice cream cone SVG graphic, and I want to transform the scoop with a transform-origin of 50% 100% (center bottom). Firefox claims to obey (i.e. the inspector notes the correct transform-origin ) but in fact transforms about the upper left corner. WebKit, bizarrely, will only obey if a parent element has font-size:100% set. These are very similar questions but only pertain to Firefox: Setting transform-origin on SVG group not working in FireFox How to set transform origin in SVG

CSS3 Skew Again! : Unskew text without parent div so form focus state is proper

一曲冷凌霜 提交于 2019-12-23 05:38:08
问题 I have a simple problem, but I may be asking for the impossible. I want to style my html form elements as parallelograms without skewing the contained text. I would normally do this by applying the transform to a parent div and applying the reverse transform to the content: http://jsfiddle.net/ExUs9/3/ form { background:#62CAD9; padding:10px; } div { background: white; height: 30px; margin: 10px; width:300px; transform:skewX(30deg); -ms-transform:skewX(30deg); -webkit-transform:skewX(30deg);

How to limit transformation of images inside canvas in window store app

故事扮演 提交于 2019-12-23 05:11:53
问题 I have been struggling for two weeks for this problem . I am applying dragging and scaling to an image inside canvas.Dragging works fine and is limiting inside canvas IsBoundary functions but when I am applying scaling its drag area changes . If increases scaling with mouse drag area increases also and whem I make it shrink in size drag area also shrinks.Help me to solve this problem of limiting scaling Thanks. Here is my code link sample 回答1: I think I understand your question. When you

Convert from ACCESS TRANSFORM COUNT/PIVOT to SQL SERVER 2005

旧巷老猫 提交于 2019-12-23 05:02:02
问题 Need some help converting from access TRANSFORM COUNT/PIVOT to SQL SERVER and here's the sql from access : TRANSFORM Count(tmpTbl.TC) AS CountOfTC SELECT tmpTbl.SID, tmpTbl.CSID, tmpTbl.M,WoOr.QCL FROM tmpTbl INNER JOIN WoOr ON tmpTbl.WO = WoOr.WO WHERE (((tmpTbl.IsSelected)=True)) GROUP BY tmpTbl.SID, tmpTbl.CSID, tmpTbl.M,WoOr.QCL PIVOT tmpTbl.TN; OUTPUT: SID | CSID | M | QCL | EPA 1 | EPA 2 | -----------------------------------------| 1 | A |GW | IV | 3 | | 2 | B |GW | IV | | 4 | ---------

Isn't property layer of UIView be readonly?

余生长醉 提交于 2019-12-23 03:29:10
问题 The property layer of UIView is described in Apple's doc as following: layer The view’s Core Animation layer used for rendering. (read-only) @property(nonatomic, readonly, retain) CALayer *layer It is obviously that it is readonly. But in my project, why it could be set as following: NSLog(@"before: %f",self.myView.laye.frame.size.width); [self.myView.layer setAffineTransform:CGAffineTransformMakeScale(2, 2)]; NSLog(@"after: %f",self.myView.laye.frame.size.width); //log shows us that the

java move a rotated shape

浪子不回头ぞ 提交于 2019-12-23 02:17:31
问题 I am implementing a java swing application which has a JPanel that serves as a drawing surface. The surface renders (active) different elements. Each element has its own shape and an affine transform which is used for rendering and collision detection (each element is drawn with local coordinates and than transformed with the affine transform - like opengl). The elements can be moved and rotated on the surface (this is done through transforms). Every time a transform is applied a Area object

CSS3DObject is Always in Front of WebGL Mesh

旧街凉风 提交于 2019-12-22 21:45:38
问题 I am mixing the CSS3D Renderer with WebGL Renderer to add HTML elements in 3D space to a WebGL scene. The CSS3DObject is in front of WebGL Meshes even though the WebGL Renderer has a higher z-index. Here is the jsfiddle http://jsfiddle.net/kd9Tc/ This is what the scene looks like. Note the back view. Whenever the CSS3DObject hits a mesh, I would like the correct depth to be displayed. I believe that this has something to do with the z-buffer or depth . I would prefer to have the text on a