mirror of https://github.com/KLayout/klayout.git
Merge pull request #2334 from KLayout/bugfix/issue-2331
Fixed issue #2331 - assertion and crash with fractional scaling and o…
This commit is contained in:
commit
e17c486cd1
|
|
@ -947,8 +947,10 @@ LayoutCanvas::screenshot ()
|
|||
void
|
||||
LayoutCanvas::resize_event (unsigned int width, unsigned int height)
|
||||
{
|
||||
unsigned int w = width * dpr () + 0.5, h = height * dpr () + 0.5;
|
||||
unsigned int wl = width * m_oversampling * dpr () + 0.5, hl = height * m_oversampling * dpr () + 0.5;
|
||||
unsigned int w = (unsigned int) ceil (width * dpr () - db::epsilon);
|
||||
unsigned int h = (unsigned int) ceil (height * dpr () - db::epsilon);
|
||||
unsigned int wl = w * m_oversampling;
|
||||
unsigned int hl = h * m_oversampling;
|
||||
|
||||
if (m_viewport.width () != w || m_viewport.height () != h ||
|
||||
m_viewport_l.width () != wl || m_viewport_l.height () != hl) {
|
||||
|
|
@ -957,8 +959,8 @@ LayoutCanvas::resize_event (unsigned int width, unsigned int height)
|
|||
m_image_cache.clear ();
|
||||
|
||||
// set the viewport to the new size
|
||||
m_viewport.set_size (width * dpr () + 0.5, height * dpr () + 0.5);
|
||||
m_viewport_l.set_size (width * m_oversampling * dpr () + 0.5, height * m_oversampling * dpr () + 0.5);
|
||||
m_viewport.set_size (w, h);
|
||||
m_viewport_l.set_size (wl, hl);
|
||||
|
||||
mouse_event_trans (db::DCplxTrans (1.0 / dpr ()) * m_viewport.trans ());
|
||||
do_redraw_all (true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue