[ https://issues.apache.org/jira/browse/FLEX-16964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13648972#comment-13648972 ]
Justin Mclean commented on FLEX-16964: -------------------------------------- Still an "issue" in Apache Flex 4.9 - should be worth looking into as potential for performance increase. > HaloBorder performance issue > ---------------------------- > > Key: FLEX-16964 > URL: https://issues.apache.org/jira/browse/FLEX-16964 > Project: Apache Flex > Issue Type: Improvement > Components: Skinning > Affects Versions: Adobe Flex SDK 3.0 (Release) > Environment: Language Found: English > Reporter: Adobe JIRA > > Steps to reproduce: > 1. Create a canvas and add a child. > 2. Add logic to move or resize the child. > 3. Run > 4. Turn show redraw regions on. > 5. Now move or resize the child. > > Actual Results: > It redraws the complete canvas > > Expected Results: > It should redraw only the changes. > > Workaround (if any): > Create a new skin by inheriting it from HaloBorder, like this (see > [adjustment]): > ======================== > package > { > import mx.skins.halo.HaloBorder; > import mx.core.mx_internal; > use namespace mx_internal; > public class FixedHaloBorder extends HaloBorder > { > public function FixedHaloBorder() > { > super(); > } > protected var prevWidth:Number; > protected var prevHeight:Number; > override protected function updateDisplayList(w:Number, h:Number):void > { > if (isNaN(w) || isNaN(h)) return; > // Store background color in an object, > // so that null is distinct from black. > backgroundColor = getBackgroundColor(); > bRoundedCorners = false; > backgroundAlphaName = "backgroundAlpha"; > backgroundHole = null; > radius = 0; > radiusObj = null; > // [adjustment] We should only draw the border and background > when the size has changed. > if(prevWidth != w || prevHeight != h) > { > drawBorder(w,h); > drawBackground(w,h); > prevWidth = w; > prevHeight = h; > } > } > > /** > * @private > * If borderStyle may have changed, clear the cached border metrics. > */ > override public function styleChanged(styleProp:String):void > { > super.styleChanged(styleProp); > // [adjustment] We have to set backgroundColor explicitly to > workaround another bug. > backgroundColor = getStyle("backgroundColor"); > > // [adjustment] We should draw the border and background when a > style has changed. > drawBorder(width,height); > drawBackground(width,height); > } > } > } > ======================== -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira