Ensure GAL::SetGridSize( const VECTOR2D& aGridSize ) use non null sizes
aGridSize.x or aGridSize.y can be null if the config file has stored 0 as size. This is illegal and crashed Kicad. The min legal value is 1.0 in internal units
This commit is contained in:
parent
77313e4398
commit
fbc3ba8c04
|
@ -881,6 +881,10 @@ public:
|
||||||
{
|
{
|
||||||
gridSize = aGridSize;
|
gridSize = aGridSize;
|
||||||
|
|
||||||
|
// Avoid stupid grid size values: a grid size should be >= 1 in internal units
|
||||||
|
gridSize.x = std::max( 1.0, gridSize.x );
|
||||||
|
gridSize.y = std::max( 1.0, gridSize.y );
|
||||||
|
|
||||||
gridOffset = VECTOR2D( (long) gridOrigin.x % (long) gridSize.x,
|
gridOffset = VECTOR2D( (long) gridOrigin.x % (long) gridSize.x,
|
||||||
(long) gridOrigin.y % (long) gridSize.y );
|
(long) gridOrigin.y % (long) gridSize.y );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue