Changeset 200:81258d8764d5 for source


Ignore:
Timestamp:
Feb 7, 2011, 6:57:13 PM (13 years ago)
Author:
fnevgeny
Branch:
default
Phase:
public
Message:

Added string rotation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/wz_jsgraphics.js

    r167 r200  
    893893Allows to specify the size of the text rectangle and to align the
    894894text 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
     896http://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               
    897911                this.htm += '<div style="position:absolute;overflow:hidden;'+
    898912                        'left:' + x + 'px;'+
     
    902916                        'font-family:' +  this.ftFam + ';'+
    903917                        'font-size:' + this.ftSz + ';'+
    904                         'color:' + this.color + ';' + this.ftSty + '">'+
     918                        'color:' + this.color + ';' + this.ftSty + angleSty + '">'+
    905919                        txt +
    906920                        '<\/div>';
Note: See TracChangeset for help on using the changeset viewer.