mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-02 02:47:48 +02:00
Merge pull request #2414 from KLayout/feature/issue-2407
Proposal for fixing issue #2407
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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 ();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
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:
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
|
||||
db::DPoint m_p1, m_p2;
|
||||
unsigned int m_color;
|
||||
unsigned int m_stipple;
|
||||
unsigned int m_line_style;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user