Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/edt/edt/edtPartialService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ PartialService::mouse_press_event (const db::DPoint &p, unsigned int buttons, bo
m_p1 = p;
m_p2 = p;
mp_box = new lay::RubberBox (ui (), m_color, p, p);
mp_box->set_stipple (6); // coarse hatched
mp_box->set_line_style (3); // long dashed dotted

ui ()->grab_mouse (this, true);

Expand Down
10 changes: 5 additions & 5 deletions src/laybasic/laybasic/layRubberBox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace lay

RubberBox::RubberBox (lay::ViewObjectUI *widget, unsigned int color, const db::DPoint &p1, const db::DPoint &p2)
: lay::ViewObject (widget, false /*not static*/),
m_p1 (p1), m_p2 (p2), m_color (color), m_stipple (0)
m_p1 (p1), m_p2 (p2), m_color (color), m_line_style (0)
{ }

void
Expand All @@ -47,10 +47,10 @@ RubberBox::set_color (unsigned int color)
}

void
RubberBox::set_stipple (unsigned int s)
RubberBox::set_line_style (unsigned int s)
{
if (m_stipple != s) {
m_stipple = s;
if (m_line_style != s) {
m_line_style = s;
redraw ();
}
}
Expand All @@ -60,7 +60,7 @@ RubberBox::render (const Viewport &vp, ViewObjectCanvas &canvas)
{
lay::Renderer &r = canvas.renderer ();
int lw = int (0.5 + 1.0 / r.resolution ());
lay::CanvasPlane *plane = canvas.plane (lay::ViewOp (m_color, lay::ViewOp::Copy, 0, m_stipple, 0, lay::ViewOp::Rect, lw));
lay::CanvasPlane *plane = canvas.plane (lay::ViewOp (m_color, lay::ViewOp::Copy, m_line_style, 0, 0, lay::ViewOp::Rect, lw));
if (plane) {
r.draw (vp.trans () * db::DBox (m_p1, m_p2), 0, plane, 0, 0);
}
Expand Down
4 changes: 2 additions & 2 deletions src/laybasic/laybasic/layRubberBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class LAYBASIC_PUBLIC RubberBox
RubberBox (lay::ViewObjectUI *canvas, unsigned int color, const db::DPoint &p1, const db::DPoint &p2);

void set_color (unsigned int color);
void set_stipple (unsigned int s);
void set_line_style (unsigned int s);
void set_points (const db::DPoint &begin, const db::DPoint &end);

private:
virtual void render (const Viewport &vp, ViewObjectCanvas &canvas);

db::DPoint m_p1, m_p2;
unsigned int m_color;
unsigned int m_stipple;
unsigned int m_line_style;
};

}
Expand Down
2 changes: 1 addition & 1 deletion src/laybasic/laybasic/laySelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ SelectionService::begin (const db::DPoint &pos)
m_p1 = pos;
m_p2 = pos;
mp_box = new lay::RubberBox (ui (), m_color, pos, pos);
mp_box->set_stipple (6); // coarse hatched
mp_box->set_line_style (4); // short dashed

ui ()->grab_mouse (this, true);
}
Expand Down