Changeset 16045 for lang/actionscript

Show
Ignore:
Timestamp:
07/20/08 03:44:05 (4 months ago)
Author:
gyuque
Message:

fixed default text format

Location:
lang/actionscript/ascss/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/actionscript/ascss/src/KyotoDemo.as

    r16000 r16045  
    1818                private var LogoEmbed:Class; 
    1919 
    20                 public static const LINEHEIGHT:int = 35; 
     20                private var LINEHEIGHT:Number = 35; 
     21                private var mPrevCalcLines:int = 0; 
    2122                public static const GRAD_COLORS:Array = [0x111111, 0x333333, 0x555555]; 
    2223                public static const GRAD_ALPHAS:Array = [1, 1, 1]; 
     
    172173                        createSelectorMarkers(parser.sheet); 
    173174                        mStyleSheet = parser.sheet; 
     175 
     176                        calcLineHeight(); 
    174177                        showSelectorMarkers(); 
    175178 
     
    188191                        } 
    189192 
     193                        calcLineHeight(); 
    190194                        showElementMarkers(); 
    191195 
    192196                        doMatching(); 
     197                } 
     198 
     199                private function calcLineHeight():void 
     200                { 
     201                        var h:int = mXMLField.textHeight; 
     202                        var maxl:int = mXMLField.numLines; 
     203                        if (mCSSField.numLines > maxl) 
     204                        { 
     205                                maxl = mCSSField.numLines; 
     206                                h = mCSSField.textHeight; 
     207                        } 
     208 
     209                        if (maxl > mPrevCalcLines && maxl > 0) 
     210                        { 
     211                                LINEHEIGHT = Number(h) / Number(maxl); 
     212                        } 
    193213                } 
    194214 
     
    431451                        { 
    432452                                var rs:RenderStyle = ed.wrapper.renderStyle; 
    433                                 var color:uint = lookupColorValue(rs, 0xffffffff, CSSPropertyID.CSSPropertyColor); 
     453                                var color:uint = lookupColorValue(rs, 0, CSSPropertyID.CSSPropertyColor); 
    434454                                var bgcolor:uint = lookupColorValue(rs, 0, CSSPropertyID.CSSPropertyBackgroundColor); 
    435455                                var bgurl:String = null;