[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Request for comments, Rulers, two types in one class
From:       Sven Langkamp <longamp () reallygood ! de>
Date:       2005-09-14 19:20:47
Message-ID: 200509142120.48144.longamp () reallygood ! de
[Download RAW message or body]

Am Dienstag, 13. September 2005 19:33 schrieb Tim Beaulen:
> Oops, this was not posted to the mailinglist.
>
> On 9/13/05, Sven Langkamp <longamp@reallygood.de> wrote:
> > The Krita ruler is intended for
> > pixel-oriented images. I'm just wondering at the moment why you switched
> > to the Krita rulers in Karbon, which is page-oriented.
> > By the way: This difference is the worst things in KOffice graphics. I
> > just
>
> Can you explain a few things for me please?
>
> What makes the Krita rulers "pixel-oriented"?
> What is page-oriented?
Ok my description was bad.

You are right that the ruler is not "pixel-oriented", thats just the case for 
Krita and I forgot that it does also display other units.

There is a difference how Krita and Karbon handle an image. In Krita the image 
is located in the to left corner of the canvas, in Karbon it's in the center 
of the image ("page-oriented").
Which is a bit annoying when you switch between the two views. 

>
> The reason I changed the rulers is because KoRuler is not fit for a
> program you use to edit graphics. It's made to be used in a text
> processing application.
> And I like the look of the Krita rulers a lot better.
>
> > wanted to use a Karbon drawing in Krita, but it's almost impossible to
> > get the right scaling.
>
> Can you explain that a bit more?
> I have no idea what you mean.
>
> You saved an image in Karbon, but when you open it in Krita, the
> scaling is wrong?
The embedded Kabon part scale the Karbon image to fit into the rect it gets 
from Krita.
If you look into KarbonPart::paint content you can see that Karbon does not 
use the zoomX/zoomY parameters and does the scaling on it's own.

I have attached a small hack that allows Krita to display the Karbon image 
with the right scaling.


["zoom.diff" (text/x-diff)]

Index: karbon/karbon_part.cc
===================================================================
--- karbon/karbon_part.cc	(Revision 460403)
+++ karbon/karbon_part.cc	(Arbeitskopie)
@@ -460,14 +460,14 @@
 
 void
 KarbonPart::paintContent( QPainter& painter, const QRect& rect,
-						  bool /*transparent*/, double /*zoomX*/, double /*zoomY*/ )
+						  bool /*transparent*/, double zoomX, double zoomY )
 {
 	kdDebug(38000) << "**** part->paintContent()" << endl;
 
 	KoRect r = KoRect::fromQRect( rect );
-	double zoomFactorX = double( r.width() ) / double( document().width() );
-	double zoomFactorY = double( r.height() ) / double( document().height() );
-	double zoomFactor = kMin( zoomFactorX, zoomFactorY );
+	//double zoomFactorX = double( r.width() ) / double( document().width() );
+	//double zoomFactorY = double( r.height() ) / double( document().height() );
+	double zoomFactor = kMin( zoomX, zoomY );
 
 	painter.eraseRect( rect );
 	VPainterFactory *painterFactory = new VPainterFactory;


_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic