mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
Ensure @width / @height are positive.
This commit is contained in:
parent
cb854c0086
commit
4ecffd8d77
@ -203,8 +203,8 @@ class Morris.Grid extends Morris.EventEmitter
|
||||
@measureText(@yAxisFormat(@ymax), @options.gridTextSize).width)
|
||||
@left += maxYLabelWidth
|
||||
@bottom -= 1.5 * @options.gridTextSize
|
||||
@width = @right - @left
|
||||
@height = @bottom - @top
|
||||
@width = Math.max(1, @right - @left)
|
||||
@height = Math.max(1, @bottom - @top)
|
||||
@dx = @width / (@xmax - @xmin)
|
||||
@dy = @height / (@ymax - @ymin)
|
||||
@calc() if @calc
|
||||
|
Loading…
Reference in New Issue
Block a user