snipt

Ctrl+h for KB shortcuts

Objective-C

Rotate object

1
2
3
4
5
6
#define RADIANS( degrees ) ( ( degrees * M_PI ) / 180.0 )

CGAffineTransform rotateTransform = CGAffineTransformRotate( CGAffineTransformIdentity,
         RADIANS( 45.0 ) );

object.transform = rotateTransform;
https://snipt.net/embed/a179c073e48f3026812ce4842099a593/
https://snipt.net/raw/a179c073e48f3026812ce4842099a593/
a179c073e48f3026812ce4842099a593
objective-c
Objective-C
6
2016-09-27T08:20:25
True
False
False
Feb 18, 2014 at 10:52 AM
/api/public/snipt/114780/
rotate-object
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">#define RADIANS( degrees ) ( ( degrees * M_PI ) / 180.0 )</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="bp">CGAffineTransform</span> <span class="n">rotateTransform</span> <span class="o">=</span> <span class="n">CGAffineTransformRotate</span><span class="p">(</span> <span class="n">CGAffineTransformIdentity</span><span class="p">,</span> </span><span id="L-4"><a name="L-4"></a> <span class="n">RADIANS</span><span class="p">(</span> <span class="mf">45.0</span> <span class="p">)</span> <span class="p">);</span> </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a><span class="n">object</span><span class="p">.</span><span class="n">transform</span> <span class="o">=</span> <span class="n">rotateTransform</span><span class="p">;</span> </span></pre></div> </td></tr></table>
rotate, rotation

JavaScript

extract the css transformation properties with Javascript

1
2
3
4
5
6
// src:http://stackoverflow.com/questions/3451402/how-to-extract-the-webkit-transformation-syntax-in-javascript
// credit : http://whattheheadsaid.com/
//
//
$(this).css('-webkit-transform').match(/[^()\s]+(?=,|\))/g);
// -> ["0.6", "0px", "2236px", "12deg"]
https://snipt.net/embed/6bd1edb1f8c82c7d09df91f49eeb50b9/
https://snipt.net/raw/6bd1edb1f8c82c7d09df91f49eeb50b9/
6bd1edb1f8c82c7d09df91f49eeb50b9
js
JavaScript
6
2016-09-26T22:03:26
True
False
False
Sep 27, 2012 at 12:51 PM
/api/public/snipt/47725/
extract-the-css-transformation-properties-with-javascript
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c1">// src:http://stackoverflow.com/questions/3451402/how-to-extract-the-webkit-transformation-syntax-in-javascript</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">// credit : http://whattheheadsaid.com/</span> </span><span id="L-3"><a name="L-3"></a><span class="c1">//</span> </span><span id="L-4"><a name="L-4"></a><span class="c1">//</span> </span><span id="L-5"><a name="L-5"></a><span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">css</span><span class="p">(</span><span class="s1">&#39;-webkit-transform&#39;</span><span class="p">).</span><span class="nx">match</span><span class="p">(</span><span class="sr">/[^()\s]+(?=,|\))/g</span><span class="p">);</span> </span><span id="L-6"><a name="L-6"></a><span class="c1">// -&gt; [&quot;0.6&quot;, &quot;0px&quot;, &quot;2236px&quot;, &quot;12deg&quot;]</span> </span></pre></div> </td></tr></table>
"css transform", css3, javascript, js, regex, rotate, rotateX, rotateY, scaleX, scaleY, transform, translate, translateX, translateY

CSS

rotate text in all browsers

1
2
3
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
https://snipt.net/embed/f86641b446fa188099c2acde3e3ebeb5/
https://snipt.net/raw/f86641b446fa188099c2acde3e3ebeb5/
f86641b446fa188099c2acde3e3ebeb5
css
CSS
3
2016-09-25T01:07:53
True
False
False
/api/public/snipt/7319/
rotate-text-in-all-browsers
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nt">-webkit-transform</span><span class="o">:</span> <span class="nt">rotate</span><span class="o">(</span><span class="nt">-90deg</span><span class="o">);</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">-moz-transform</span><span class="o">:</span> <span class="nt">rotate</span><span class="o">(</span><span class="nt">-90deg</span><span class="o">);</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">filter</span><span class="o">:</span> <span class="nt">progid</span><span class="nd">:DXImageTransform</span><span class="nc">.Microsoft.BasicImage</span><span class="o">(</span><span class="nt">rotation</span><span class="o">=</span><span class="nt">3</span><span class="o">);</span> </span></pre></div> </td></tr></table>
css, rotate, text
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.