lib/gamebox/core/svg_document.rb
# The bezier path object must have all its nodes turned "sharp",
# or non-curve-handle-ish, or this parser will not work properly
The bezier path object must have all its nodes turned "sharp",
or non-curve-handle-ish, or this parser will not work properly
The bezier path object must have all its nodes turned " sharp " or non - curve - handle - ish or this parser will not work properly
def vertices
      unless @verts
        @verts = []
        data = @node.attributes['d']
        scanner = StringScanner.new(data)
        pat = /[ML]\s+([-0-9.,]+)\s*/
        hit = scanner.scan(pat)
        while hit
          x,y = scanner[1].split(/,/).map { |s| s.to_f }
          @verts << vec2(x,y)
          hit = scanner.scan(pat)
        end
      end
      @verts
    end
def vertices unless @verts @verts = [ ] data = @node . attributes [ 'd' ] scanner = StringScanner . new ( data ) pat = / [ML] \s +([-0-9.,]+) \s * / hit = scanner . scan ( pat ) while hit x , y = scanner [ 1 ] . split ( / , / ) . map { | s | s . to_f } @verts << vec2 ( x , y ) hit = scanner . scan ( pat ) end end @verts end
The bezier path object must have all its nodes turned "sharp",
or non-curve-handle-ish, or this parser will not work properly
The bezier path object must have all its nodes turned " sharp " or non - curve - handle - ish or this parser will not work properly