Summary: | Child panels do not scale on zooming | ||
---|---|---|---|
Product: | [Applications] calligrasheets | Reporter: | J E Drews <j.e.drews> |
Component: | general | Assignee: | Philipp Müller <philipp.mueller> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
J E Drews
2002-07-19 22:19:43 UTC
Those are KChart and KFormula bugs (missing zooming feature). Will reassign to, hmm, kchart - please move bug to kformula when kchart is fixed ;-) David, why didn't you move it to KSpread? The childs of KSpread are here not transformed/zoomed correctly when KSpread itself is embedded. That's what I see here (and I was assuming to get such bugs already). However, Moved to KSpread, me as owner. I tested this again in koffice 1.2.1, in kde 3.1.0. The child panels do not zoom. I am using FreeBSD 4.8 RC. Koffice is compiled from ports. gcc version 2.95.4 20020320 [FreeBSD] Subject: koffice/kspread CVS commit by ariya: when embedded, use real zoom instead of scaling CCMAIL: 45503@bugs.kde.org M +2 -1 kspread_canvas.cc 1.394 M +22 -11 kspread_doc.cc 1.249 --- koffice/kspread/kspread_canvas.cc #1.393:1.394 @@ -3557,5 +3557,6 @@ void KSpreadCanvas::paintChildren( QPain // #### todo: paint only if child is visible inside rect painter.save(); - m_pDoc->paintChild( itChild.current(), painter, m_pView ); + m_pDoc->paintChild( itChild.current(), painter, m_pView, + m_pDoc->zoomedResolutionX(), m_pDoc->zoomedResolutionY() ); painter.restore(); } --- koffice/kspread/kspread_doc.cc #1.248:1.249 @@ -790,13 +790,9 @@ void KSpreadDoc::paintContent( QPainter& // ElapsedTime et( "KSpreadDoc::paintContent1" ); //kdDebug(36001) << "KSpreadDoc::paintContent m_zoom=" << m_zoom << " zoomX=" << zoomX << " zoomY=" << zoomY << " transparent=" << transparent << endl; + + // save current zoom int oldZoom = m_zoom; - setZoomAndResolution( 100, QPaintDevice::x11AppDpiX(), QPaintDevice::x11AppDpiY() ); - if ( m_zoomedResolutionX != zoomX || m_zoomedResolutionY != zoomY ) - { - setResolution( zoomX, zoomY ); - bool forPrint = painter.device() && painter.device()->devType() == QInternal::Printer; - newZoomAndResolution( false, forPrint ); - } + // choose sheet: the first or the active KSpreadSheet* table = 0L; if ( !m_activeTable ) @@ -807,11 +803,26 @@ void KSpreadDoc::paintContent( QPainter& return; - kdDebug(36001)<<"paintContent-------------------------------------\n"; - painter.save(); + // only one zoom is supported + double d_zoom = 1.0; + setZoomAndResolution( 100, QPaintDevice::x11AppDpiX(), QPaintDevice::x11AppDpiY() ); + if ( m_zoomedResolutionX != zoomX ) + d_zoom *= ( zoomX / m_zoomedResolutionX ); - // painter.scale(zoomX, zoomY); - paintContent( painter, rect, transparent, table, false ); + // KSpread support zoom, therefore no need to scale with worldMatrix + QWMatrix matrix = painter.worldMatrix(); + matrix.setMatrix( 1, 0, 0, 1, matrix.dx(), matrix.dy() ); + QRect prect = rect; + prect.setWidth( prect.width() * painter.worldMatrix().m11() ); + prect.setHeight( prect.height() * painter.worldMatrix().m22() ); + setZoomAndResolution( d_zoom * 100, QPaintDevice::x11AppDpiX(), QPaintDevice::x11AppDpiY() ); + // paint the content, now zoom is correctly set + kdDebug(36001)<<"paintContent-------------------------------------\n"; + painter.save(); + painter.setWorldMatrix( matrix ); + paintContent( painter, prect, transparent, table, false ); painter.restore(); + + // restore zoom m_zoom = oldZoom; setZoomAndResolution( oldZoom, QPaintDevice::x11AppDpiX(), QPaintDevice::x11AppDpiY() ); Close this -- it is 2 years old and I have no idea if it's fixed. I don't use Kde anymore. |