[OpenLayers-Trac] Re: [OpenLayers] #3442: Fix OpenLayers.Renderer.Canvas.drawFeature method in case if feature's bounds are empty

OpenLayers trac-20090302 at openlayers.org
Tue Aug 2 03:33:36 EDT 2011


#3442: Fix OpenLayers.Renderer.Canvas.drawFeature method in case if feature's
bounds are empty
-----------------------------+----------------------------------------------
 Reporter:  arublev          |       Owner:  crschmidt   
     Type:  bug              |      Status:  new         
 Priority:  major            |   Milestone:  2.11 Release
Component:  Renderer.Canvas  |     Version:  2.11 RC1    
 Keywords:                   |       State:  Review      
-----------------------------+----------------------------------------------

Comment(by fredj):

 attachment:"3442.1.patch" adds units tests (using a Polygon geometry with
 no coordinates: {{{new OpenLayers.Geometry.Polygon().getBounds()}}}
 returns {{{null}}}).

 I've also updated the test in {{{drawFeature}}}: instead of:
 {{{
 rendered = (style.display !== "none") && bounds &&
 bounds.intersectsBounds(this.extent)
 }}}
 it's now:
 {{{
 rendered = !!(style.display !== "none" && bounds &&
 bounds.intersectsBounds(this.extent))
 }}}
 because if {{{bounds}}} is {{{null}}}, {{{rendered}}} equals {{{null}}}.

 A side effect of writing unit tests: finding bugs :-)

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3442#comment:5>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list