On Thu, Sep 20, 2012 at 11:44 PM, Thomas Geymayerwrote: > I've now changed the default fill rule from even-odd to non-zero. Should > probably work better now...
Surprisingly, this didn't seem to make any difference. I've included the patch below if you want to check yourself. -Stuart diff --git a/Nasal/canvas/map.nas b/Nasal/canvas/map.nas index 8aaeab8..53c41cf 100644 --- a/Nasal/canvas/map.nas +++ b/Nasal/canvas/map.nas @@ -76,38 +76,45 @@ var AirportMap = { me.grp_apt = layer_runways.createChild("group", "apt-" ~ me._apt.id); # Taxiways drawn first so the runways and parking positions end up on top. - if (me._display_taxiways) + if (me._display_taxiways and (size(me._apt.taxiways) > 0)) { + # For efficiency we create all taxiways as the same path object, + # and assume they all have the same surface. + var clr = SURFACECOLORS[me._apt.taxiways[0].surface]; + if (clr == nil) { clr = SURFACECOLORS[0]}; + + var icon_taxi = + me.grp_apt.createChild("path", "taxi") + .setStrokeLineWidth(0) + .setColor(clr.r, clr.g, clr.b) + .setColorFill(clr.r, clr.g, clr.b); + + var cmds = []; + var coords = []; + foreach(var taxi; me._apt.taxiways) { - var clr = SURFACECOLORS[taxi.surface]; - if (clr == nil) { clr = SURFACECOLORS[0]}; - - var icon_taxi = - me.grp_apt.createChild("path", "taxi") - .setStrokeLineWidth(0) - .setColor(clr.r, clr.g, clr.b) - .setColorFill(clr.r, clr.g, clr.b); - var txi = Runway.new(taxi); var beg1 = txi.pointOffCenterline(0, 0.5 * taxi.width); var beg2 = txi.pointOffCenterline(0, -0.5 * taxi.width); var end1 = txi.pointOffCenterline(taxi.length, 0.5 * taxi.width); var end2 = txi.pointOffCenterline(taxi.length, -0.5 * taxi.width); - - icon_taxi.setDataGeo - ( - [ canvas.Path.VG_MOVE_TO, - canvas.Path.VG_LINE_TO, - canvas.Path.VG_LINE_TO, - canvas.Path.VG_LINE_TO, - canvas.Path.VG_CLOSE_PATH ], - [ beg1[0], beg1[1], - beg2[0], beg2[1], - end2[0], end2[1], - end1[0], end1[1] ] - ); + + append(cmds, + canvas.Path.VG_MOVE_TO, + canvas.Path.VG_LINE_TO, + canvas.Path.VG_LINE_TO, + canvas.Path.VG_LINE_TO, + canvas.Path.VG_CLOSE_PATH); + + append(coords, + beg1[0], beg1[1], + beg2[0], beg2[1], + end2[0], end2[1], + end1[0], end1[1]); } + + icon_taxi.setDataGeo(cmds, coords); } if (me._display_runways) ------------------------------------------------------------------------------ Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel