[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: Patch for KIllustrator and KWord (XIM)
From: Toshitaka Fujioka <toshitaka () kde ! gr ! jp>
Date: 2001-07-17 12:15:02
[Download RAW message or body]
On Tuesday 17 July 2001 19:25, David Faure wrote:
> On Tuesday 17 July 2001 11:17, Toshitaka Fujioka wrote:
> > On Monday 16 July 2001 21:53, David Faure wrote:
> > > On Monday 16 July 2001 12:44, Toshitaka Fujioka wrote:
> > > > On Monday 16 July 2001 06:58, David Faure wrote:
> > > > > On Monday 16 July 2001 00:11, Toshitaka Fujioka wrote:
> > > > > > On Friday 13 July 2001 19:42, Toshitaka Fujioka wrote:
> > > > > > > Oops! :o Sorry, You're 100% right. This was bad patch(KWord).
> > > > > > > :( I remade patch. This patch completely works. ;)
> > > > > >
> > > > > > Oops!! Oh no, I did it again. :o
> > > > > > Sorry, the patch was not complete. :(
> > > > > > When "Line Spacing" was not "Single", XIM position was
> > > > > > incomplete. I remade a patch. Please review.
> > > > >
> > > > > Eek, this is horrible (sorry). We want to add more linespacings in
> > > > > the future, without having to update this code. To get the
> > > > > linespacing in pixels, just use parag->lineSpacing( linenumber ) -
> > > > > but I'm surprised you even have to do this.
> > > > >
> > > > > What are you trying to do exactly ?
> > > > > Getting the bottom of the cursor ?
> > > >
> > > > Yes.
> > > >
> > > > >(Simply use cPoint.y() + h)
> > > >
> > > > Hmm, this is right with "Line Spacing is Single".
> > > >
> > > > > Getting the bottom of the current line, including the linespacing ?
> > > >
> > > > This is a problem. Because, value is added to "h" when I changed
> > > > "Line Spacing". Position of XIM falls down to only value added to
> > > > "h". I must subtract added value from "h" in order to set position of
> > > > XIM to a bottom of cursor.
> > >
> > > Ok. Does it work better this way ?
> > >
> > > int line;
> > > cursor->parag()->lineStartOfChar( cursor->index(), 0, &line
> > > ); canvas->setXimPosition( cPoint.x(), cPoint.y(), 0, h -
> > > cursor->parag()->lineSpacing( line ) );
> >
> > QPoint ximPoint = viewMode->normalToView( clip.topRight() );
>
> Out of curiosity, why topRight ?
> Why does it depend on the clip rect ?
case of ximPoint.x():
http://www.kde.gr.jp/~toshitaka/Kde/KOffice/KWord/xim1.png
case of cPoint.x():
http://www.kde.gr.jp/~toshitaka/Kde/KOffice/KWord/xim2.png
XIM position is delicately wrong. ximPoint.x() is better.
> > canvas->setXimPosition( ximPoint.x(), ximPoint.y(), 0, h -
> > cursor->parag()->lineSpacing( lineY ) );
>
> lineY can't be right. That's a Y coordinate, whereas lineSpacing() takes a
> line _number_. That's what I was calculating in my patch: the line number
> of the line where the cursor is, and that's what you need when calling
> lineSpacing().
Hmm, I see. But return value of cursor->parag()->lineSpacing( lineY ) is
same as
int line;
cursor->parag()->lineStartOfChar( cursor->index(), 0, &line );
.
Thank you.
--
Toshitaka Fujioka
http://www.kde.org The K Desktop Environment Project
fujioka@kde.org
http://www.kde.gr.jp Japan KDE User's Group
toshitaka@kde.gr.jp
-- We offer the best Desktop Environment to you. (This is my goal. ;-)) --
_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.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