Changeset 200:81258d8764d5 for source/wz_jsgraphics.js
- Timestamp:
- Feb 7, 2011, 6:57:13 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/wz_jsgraphics.js
r167 r200 893 893 Allows to specify the size of the text rectangle and to align the 894 894 text both horizontally (e.g. right) and vertically within that rectangle */ 895 this.drawStringRect = function(txt, x, y, width, halign) 896 { 895 /* ES: added rotation, using 896 http://stackoverflow.com/questions/272799/vertical-rotated-text-in-html-table */ 897 this.drawStringRect = function(txt, x, y, width, halign, angle) 898 { 899 var angleSty = ''; 900 if (angle) { 901 angle = parseInt(angle); 902 var rot = angle/90; 903 angleSty = 904 '-moz-transform: rotate(' + angle + 'deg);' + /* FF3.5+ */ 905 '-o-transform: rotate(' + angle + 'deg);' + /* Opera 10.5 */ 906 '-webkit-transform: rotate(' + angle + 'deg);' + /* Saf3.1+, Chrome */ 907 'filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=' + rot + ');' + /* IE6,IE7 */ 908 '-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=' + rot + ');'; /* IE8 */ 909 } 910 897 911 this.htm += '<div style="position:absolute;overflow:hidden;'+ 898 912 'left:' + x + 'px;'+ … … 902 916 'font-family:' + this.ftFam + ';'+ 903 917 'font-size:' + this.ftSz + ';'+ 904 'color:' + this.color + ';' + this.ftSty + '">'+918 'color:' + this.color + ';' + this.ftSty + angleSty + '">'+ 905 919 txt + 906 920 '<\/div>';
Note: See TracChangeset
for help on using the changeset viewer.