Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 43911200B52 for ; Mon, 25 Jul 2016 12:09:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 424B0160A9E; Mon, 25 Jul 2016 10:09:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6B53A160A98 for ; Mon, 25 Jul 2016 12:09:21 +0200 (CEST) Received: (qmail 99197 invoked by uid 500); 25 Jul 2016 10:09:20 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 98661 invoked by uid 99); 25 Jul 2016 10:09:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2016 10:09:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BEC99E78B5; Mon, 25 Jul 2016 10:09:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: harbs@apache.org To: commits@flex.apache.org Date: Mon, 25 Jul 2016 10:09:33 -0000 Message-Id: <70086f0e56c445d4b21703e4f3b6dbc2@git.apache.org> In-Reply-To: <01c31763342b44979d728c17bbddd158@git.apache.org> References: <01c31763342b44979d728c17bbddd158@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [15/21] git commit: [flex-asjs] [refs/heads/develop] - Added line properties archived-at: Mon, 25 Jul 2016 10:09:22 -0000 Added line properties Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a3b297b5 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a3b297b5 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a3b297b5 Branch: refs/heads/develop Commit: a3b297b51015a2a71190df33ed618f3df4f8188d Parents: 11136dc Author: Harbs Authored: Sun Jul 24 20:32:42 2016 +0300 Committer: Harbs Committed: Sun Jul 24 20:32:42 2016 +0300 ---------------------------------------------------------------------- .../flex/org/apache/flex/graphics/IStroke.as | 2 + .../apache/flex/graphics/SolidColorStroke.as | 76 ++++++++++++++++++-- 2 files changed, 74 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a3b297b5/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 a2c647f..c850cac 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 @@ -31,6 +31,8 @@ package org.apache.flex.graphics function set lineJoin(val:String):void; function get miterLimit():Number; function set miterLimit(val:Number):void; + function get lineDash():Array; + function set lineDash(val:Array):void; } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a3b297b5/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 e301250..d64c35b 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 @@ -19,13 +19,16 @@ package org.apache.flex.graphics COMPILE::SWF { import flash.display.CapsStyle; - import flash.display.JointStyle; + import flash.display.JointStyle; } public class SolidColorStroke implements IStroke { - public function SolidColorStroke() + public function SolidColorStroke(color:uint = 0x000000,weight:Number = 1, alpha:Number = 1.0) { + _color = isNaN(color) ? 0 : color; + _weight = isNaN(weight) ? 1 : weight; + _alpha = isNaN(alpha) ? 1 : alpha; COMPILE::SWF { _lineCap = "none"; @@ -131,11 +134,32 @@ package org.apache.flex.graphics COMPILE::JS public function addStrokeAttrib(value:IGraphicShape):String { - return 'stroke:' + CSSUtils.attributeFromColor(color) + ';stroke-width:' + - String(weight) + ';stroke-opacity:' + String(alpha); + 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)); + if(lineDash && lineDash.length) + att.push('stroke-dasharray:' + lineDash.join(",")); + return att.join(";"); }; private var _lineCap:String; + /** + * The cap type on line segments. + * Possible values are butt round and square. + * + * @default butt + * + * @see org.apache.flex.graphics.LineStyle + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.3 + */ public function get lineCap():String { return _lineCap; @@ -161,6 +185,20 @@ package org.apache.flex.graphics } private var _lineJoin:String = "miter"; + + /** + * The join type of two segments. + * Possible values are miter round and bevel. + * + * @default miter + * + * @see org.apache.flex.graphics.LineStyle + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.7 + */ public function get lineJoin():String { return _lineJoin; @@ -170,6 +208,16 @@ package org.apache.flex.graphics _lineJoin = val; } private var _miterLimit:Number = 4; + /** + * The miter limit at the join of two segments. + * + * @default 4 + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.7 + */ public function get miterLimit():Number { return _miterLimit; @@ -179,5 +227,25 @@ package org.apache.flex.graphics _miterLimit = val; } + private var _lineDash:Array; + /** + * An array describing the pattern of line dashes. + * + * @default [none] + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.7 + */ + public function get lineDash():Array + { + return _lineDash; + } + public function set lineDash(val:Array):void + { + _lineDash = val; + } + } }