Created
October 28, 2015 19:18
-
-
Save arfie/c65a985b4fdca31c6936 to your computer and use it in GitHub Desktop.
TagPro Radians
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name TagPro Radians | |
// @namespace http://www.arfie.nl | |
// @version 0.1 | |
// @author Ruud Verbeek | |
// @include http://tagpro-*.koalabeast.com:* | |
// @include http://tangent.jukejuice.com:* | |
// @include http://*.newcompte.fr:* | |
// ==/UserScript== | |
var a = function() { | |
var special = { | |
0: "0", | |
45: "¼π", | |
90: "½π", | |
135: "¾π", | |
180: "π", | |
225: "1¼π", | |
270: "1½π", | |
315: "1¾π", | |
360: "2π" | |
}; | |
function toRadians(x) { | |
return special[x] || (Math.PI * x / 180).toFixed(2); | |
} | |
tagpro.renderer.drawDegree = function(e) { | |
tagpro.settings.ui.degrees && (e.degree && (e.sprites.info.removeChild(e.sprites.degrees), e.sprites.degrees = tagpro.renderer.veryPrettyText(toRadians(e.degree)), | |
e.sprites.info.addChild(e.sprites.degrees)), | |
e.sprites.degrees && (e.sprites.degrees.x = 25, | |
e.sprites.degrees.y = -10)) | |
}; | |
},b=function(){tagpro?tagpro.ready(a):setTimeout(b,0);};b(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment