if (!graphicView->isGridOn())
return;
- Drawing * graphic = graphicView->getGraphic();
+ Drawing * drawing = graphicView->GetDrawing();
// auto scale grid?
settings.beginGroup("Appearance");
// get grid setting
Vector userGrid;
- if (graphic != NULL)
- userGrid = graphic->getVariableVector("$GRIDUNIT", Vector(-1.0, -1.0));
+ if (drawing != NULL)
+ userGrid = drawing->getVariableVector("$GRIDUNIT", Vector(-1.0, -1.0));
// delete old grid:
if (pt != NULL)
RS2::Unit unit = RS2::None;
RS2::LinearFormat format = RS2::Decimal;
- if (graphic != NULL)
+ if (drawing != NULL)
{
- unit = graphic->getUnit();
- format = graphic->getLinearFormat();
+ unit = drawing->getUnit();
+ format = drawing->getLinearFormat();
}
Vector gridWidth;
&& graphicView->toGuiDY(gridWidth.y) > 2)
{
// find grid boundaries
- double left = (int)(graphicView->toGraphX(0) / gridWidth.x)
- * gridWidth.x;
+ double left = (int)(graphicView->toGraphX(0) / gridWidth.x) * gridWidth.x;
double right = (int)(graphicView->toGraphX(graphicView->getWidth())
/ gridWidth.x) * gridWidth.x;
- double top = (int)(graphicView->toGraphY(0)
+ double top = (int)(graphicView->toGraphY(0) / gridWidth.y) * gridWidth.y;
+ double bottom = (int)(graphicView->toGraphY(graphicView->getHeight())
/ gridWidth.y) * gridWidth.y;
- double bottom =
- (int)(graphicView->toGraphY(graphicView->getHeight())
- / gridWidth.y) * gridWidth.y;
-
left -= gridWidth.x;
right += gridWidth.x;