mirror of
https://github.com/rastapasta/mapscii.git
synced 2024-11-25 01:23:58 +01:00
📐 don't try to paint post-reduction-invalid polygons
This commit is contained in:
parent
f2cbeb465e
commit
74a4dffbe7
@ -50,7 +50,11 @@ module.exports = class Canvas
|
||||
|
||||
for ring in rings
|
||||
if vertices.length
|
||||
continue if ring.length < 3
|
||||
holes.push vertices.length/2
|
||||
else
|
||||
return if ring.length < 3
|
||||
|
||||
for point in ring
|
||||
vertices = vertices.concat point
|
||||
|
||||
|
@ -292,12 +292,12 @@ module.exports = class Renderer
|
||||
# else
|
||||
# scaled = ([point.x, point.y] for point in simplify scaled, 2, false)
|
||||
|
||||
if filter
|
||||
if scaled.length is 2
|
||||
if @_seen[ka = (scaled[0]<<8)+scaled[1]] or
|
||||
@_seen[kb = (scaled[1]<<8)+scaled[0]]
|
||||
return []
|
||||
|
||||
@_seen[ka] = @_seen[kb] = true
|
||||
# if filter
|
||||
# if scaled.length is 2
|
||||
# if @_seen[ka = (scaled[0]<<8)+scaled[1]] or
|
||||
# @_seen[kb = (scaled[1]<<8)+scaled[0]]
|
||||
# return []
|
||||
#
|
||||
# @_seen[ka] = @_seen[kb] = true
|
||||
|
||||
scaled
|
||||
|
@ -188,7 +188,7 @@ module.exports = class Termap
|
||||
@zoom += @zoomy * @config.zoomStep
|
||||
else
|
||||
@zoomy *= -1
|
||||
@_draw()
|
||||
setImmediate => @_draw()
|
||||
|
||||
_getFooter: ->
|
||||
# features = @renderer.featuresAt @mousePosition.x-1-(@view[0]>>1), @mousePosition.y-1-(@view[1]>>2)
|
||||
|
@ -72,7 +72,7 @@ class Tile
|
||||
|
||||
# TODO: monkey patching test case for tiles with a reduced extent 4096 / 8 -> 512
|
||||
# use feature.loadGeometry() again as soon as we got a 512 extent tileset
|
||||
geometries = feature.loadGeometry() #@_reduceGeometry feature, 8
|
||||
geometries = feature.@_reduceGeometry feature, 8
|
||||
|
||||
if style.type is "fill"
|
||||
nodes.push @_addBoundaries true,
|
||||
|
Loading…
Reference in New Issue
Block a user