flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Added setLineStyle method to strokes
Date Tue, 26 Jul 2016 21:13:32 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 498287b27 -> e9dbfab76


Added setLineStyle method to strokes


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/e9dbfab7
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/e9dbfab7
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/e9dbfab7

Branch: refs/heads/develop
Commit: e9dbfab76cd4c106476529ecb211cd5e1df991bd
Parents: 498287b
Author: Harbs <harbs@in-tools.com>
Authored: Wed Jul 27 00:13:26 2016 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Wed Jul 27 00:13:26 2016 +0300

----------------------------------------------------------------------
 .../org/apache/flex/graphics/GradientBase.as    |  2 +-
 .../flex/org/apache/flex/graphics/IStroke.as    |  1 +
 .../flex/org/apache/flex/graphics/SolidColor.as |  2 +-
 .../apache/flex/graphics/SolidColorStroke.as    | 30 +++++++++++++++-----
 .../flex/org/apache/flex/svg/LinearGradient.as  |  4 +--
 .../main/flex/org/apache/flex/html/Slider.as    |  2 +-
 6 files changed, 29 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as
index 8b62ed6..bcc46c2 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as
@@ -50,7 +50,7 @@ package org.apache.flex.graphics
          */
         public function get newId():String
         {
-            return 'gradient' + String(Math.floor((Math.random() * 100000) + 1));
+            return 'gradient' + Math.floor((Math.random() * 100000) + 1);
         }
 
 		/**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
index 8cd781f..fc17f24 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
@@ -33,6 +33,7 @@ package org.apache.flex.graphics
         function set miterLimit(val:Number):void;
         function get lineDash():Array;
         function set lineDash(val:Array):void;
+		function setLineStyle(weight:Number=NaN,color:uint=0,alpha:Number = NaN,caps:String = null,
joints:String = null, miterLimit:Number = NaN):void
 
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
index e3a2888..126193a 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
@@ -128,7 +128,7 @@ package org.apache.flex.graphics
         COMPILE::JS
         public function addFillAttrib(value:IGraphicShape):String
         {
-            return 'fill:' + CSSUtils.attributeFromColor(color) + ';fill-opacity:' + String(alpha);
+            return 'fill:' + CSSUtils.attributeFromColor(color) + ';fill-opacity:' + alpha;
         }
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
index d64c35b..4efb417 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
@@ -134,13 +134,14 @@ package org.apache.flex.graphics
         COMPILE::JS
         public function addStrokeAttrib(value:IGraphicShape):String
         {
-            var att:Array = [];
-            att.push('stroke:' + CSSUtils.attributeFromColor(color));
-            att.push('stroke-width:' + String(weight));
-            att.push('stroke-opacity:' + String(alpha));
-            att.push('stroke-linecap:' + lineCap);
-            att.push('stroke-linejoin:' + lineJoin);
-            att.push('stroke-miterlimit:' + String(miterLimit));
+            var att:Array = [
+                'stroke:' + CSSUtils.attributeFromColor(color),
+                'stroke-width:' + weight,
+                'stroke-opacity:' + alpha,
+                'stroke-linecap:' + lineCap,
+                'stroke-linejoin:' + lineJoin,
+                'stroke-miterlimit:' + miterLimit
+            ];
             if(lineDash && lineDash.length)
                 att.push('stroke-dasharray:' + lineDash.join(","));
             return att.join(";");
@@ -246,6 +247,21 @@ package org.apache.flex.graphics
         {
             _lineDash = val;
         }
+		
+		public function setLineStyle(weight:Number=NaN,color:uint=0,alpha:Number = NaN,caps:String
= null, joints:String = null, miterLimit:Number = NaN):void
+		{
+			if(!isNaN(weight))
+				_weight = weight;
+			_color = color;
+			if(!isNaN(alpha))
+				_alpha = alpha;
+			if(caps)
+				_lineCap = caps;
+			if(joints)
+				_lineJoin = joints;
+			if(!isNaN(miterLimit))
+				_miterLimit = miterLimit;
+		}
 
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as
index affee7a..7da2b2a 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as
@@ -102,12 +102,12 @@ package org.apache.flex.svg
                 var gradientEntry:GradientEntry = entries[i];
                 var stop:HTMLElement = document.createElementNS(svgNS, 'stop') as HTMLElement;
                 //Set Offset
-                stop.setAttribute('offset', String(gradientEntry.ratio * 100) + '%');
+                stop.setAttribute('offset', "" + (gradientEntry.ratio * 100) + '%');
                 //Set Color
 				CSSUtils.attributeFromColor(gradientEntry.color)
                 stop.setAttribute('stop-color', CSSUtils.attributeFromColor(gradientEntry.color));
                 //Set Alpha
-                stop.setAttribute('stop-opacity', String(gradientEntry.alpha));
+                stop.setAttribute('stop-opacity', gradientEntry.alpha);
                 
                 grad.appendChild(stop);
             }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
index 6944895..d10891c 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
@@ -226,7 +226,7 @@ package org.apache.flex.html
             var xloc:Number = p * (parseInt(track.element.style.width, 10) -
                 parseInt(thumb.element.style.width, 10));
             
-            thumb.element.style.left = String(xloc) + 'px';
+            thumb.element.style.left = "" + xloc + 'px';
         }        
 
     }


Mime
View raw message