Skip to content

Commit

Permalink
Sketcher: fix issue #2788
Browse files Browse the repository at this point in the history
  • Loading branch information
AjinkyaDahale authored and wwmayer committed Feb 27, 2017
1 parent 5084b96 commit 2ecacef
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/Mod/Part/Gui/ViewProvider2DObject.cpp
Expand Up @@ -143,7 +143,6 @@ SoSeparator* ViewProvider2DObject::createGrid(void)

// gridlines
mycolor = new SoBaseColor;

mycolor->rgb.setValue(0.7f, 0.7f ,0.7f);
parent->addChild(mycolor);

Expand Down Expand Up @@ -189,19 +188,17 @@ SoSeparator* ViewProvider2DObject::createGrid(void)
SbVec3f* coords = vts->vertex.startEditing();

// vertical lines
float vx = MiX;
int i_offset_x = static_cast<int>(MiX / Step);
for (int i=0; i<vlines; i++) {
coords[2*i].setValue(vx, MiY, zGrid);
coords[2*i+1].setValue(vx, MaY, zGrid);
vx += Step;
coords[2*i].setValue((i+i_offset_x)*Step, MiY, zGrid);
coords[2*i+1].setValue((i+i_offset_x)*Step, MaY, zGrid);
}

// horizontal lines
float vy = MiY;
int i_offset_y = static_cast<int>(MiY / Step);
for (int i=vlines; i<lines; i++) {
coords[2*i].setValue(MiX, vy, zGrid);
coords[2*i+1].setValue(MaX, vy, zGrid);
vy += Step;
coords[2*i].setValue(MiX, (i-vlines+i_offset_y)*Step, zGrid);
coords[2*i+1].setValue(MaX, (i-vlines+i_offset_y)*Step, zGrid);
}
vts->vertex.finishEditing();

Expand Down

0 comments on commit 2ecacef

Please sign in to comment.