Code coverage report for fontkit/src/glyph/BBox.coffee

Statements: 93.75% (15 / 16)      Branches: 100% (8 / 8)      Functions: 83.33% (5 / 6)      Lines: 93.75% (15 / 16)      Ignored: none     

All files » fontkit/src/glyph/ » BBox.coffee
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 281 1     1 3   1       580 100   580 74   580 98   580 128     8   1  
class BBox
  get = require('../get')(this)
  constructor: (@minX = Infinity, @minY = Infinity, @maxX = -Infinity, @maxY = -Infinity) ->
      
  get 'width', ->
    @maxX - @minX
    
  get 'height', ->
    @maxY - @minY
    
  addPoint: (x, y) ->
    if x < @minX
      @minX = x
      
    if y < @minY
      @minY = y
      
    if x > @maxX
      @maxX = x
      
    if y > @maxY
      @maxY = y
      
  copy: ->
    return new BBox @minX, @minY, @maxX, @maxY
 
module.exports = BBox