|
SVN commit 996141 by aclemens:
I would suggest to display the draw cursor all the time, so it is easier to set the correct size in the panel. Right now we show the cursor only when pressing the mouse. One question: Why do we allow to set a size of 100 in the panel for the brush size, but disallow the maximum size in the mouseMoveEvent? In there we only allow a max size of 64, which looks weird, because the mask "blob" we draw is bigger as the cursor. Is this some old, "wrong" code? Andi CCMAIL:[hidden email] M +7 -4 imageguidewidget.cpp --- trunk/extragear/graphics/digikam/libs/widgets/imageplugins/imageguidewidget.cpp #996140:996141 @@ -720,7 +720,7 @@ d->spot.setX(e->x()-d->rect.x()); d->spot.setY(e->y()-d->rect.y()); } - else if ((e->buttons() & Qt::LeftButton) && d->drawingMask) + else if (d->enableDrawMask) { int size = d->penWidth; if (size>64) @@ -731,9 +731,12 @@ p.drawEllipse( 0, 0, size-1, size-1); setCursor(QCursor(pix)); - QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y()-d->rect.y()); - drawLineTo(currentPos); - updatePreview(); + if ((e->buttons() & Qt::LeftButton) && d->drawingMask) + { + QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y()-d->rect.y()); + drawLineTo(currentPos); + updatePreview(); + } } } else _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
|
Hi andi
The limitation of the size of the cursor was made on purpose. When I tried a size bigger than 64 the drawing of the cursor was broken: I had some artefacts. It may depend on the platform, I think 64 is a limitation of x window. Julien Le 13 juil. 2009 à 23:46, Andi Clemens <[hidden email]> a écrit : > SVN commit 996141 by aclemens: > > I would suggest to display the draw cursor all the time, so it is > easier to set the correct size in the panel. > Right now we show the cursor only when pressing the mouse. > > One question: Why do we allow to set a size of 100 in the panel for > the > brush size, but disallow the maximum size in the mouseMoveEvent? > In there we only allow a max size of 64, which looks weird, because > the > mask "blob" we draw is bigger as the cursor. > > Is this some old, "wrong" code? > > Andi > > CCMAIL:[hidden email] > > M +7 -4 imageguidewidget.cpp > > > --- trunk/extragear/graphics/digikam/libs/widgets/imageplugins/ > imageguidewidget.cpp #996140:996141 > @@ -720,7 +720,7 @@ > d->spot.setX(e->x()-d->rect.x()); > d->spot.setY(e->y()-d->rect.y()); > } > - else if ((e->buttons() & Qt::LeftButton) && d->drawingMask) > + else if (d->enableDrawMask) > { > int size = d->penWidth; > if (size>64) > @@ -731,9 +731,12 @@ > p.drawEllipse( 0, 0, size-1, size-1); > setCursor(QCursor(pix)); > > - QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y()-d- > >rect.y()); > - drawLineTo(currentPos); > - updatePreview(); > + if ((e->buttons() & Qt::LeftButton) && d->drawingMask) > + { > + QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y > ()-d->rect.y()); > + drawLineTo(currentPos); > + updatePreview(); > + } > } > } > else > _______________________________________________ > Digikam-devel mailing list > [hidden email] > https://mail.kde.org/mailman/listinfo/digikam-devel Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
|
Really? But why is it working in Gimp and Krita?
Ok Gimp is GTK, but Krita uses KDE / Qt, too, they don't have such limitations. Andi On Tuesday 14 July 2009 08:55:19 Julien Narboux wrote: > Hi andi > > The limitation of the size of the cursor was made on purpose. When I > tried a size bigger than 64 the drawing of the cursor was broken: I > had some artefacts. It may depend on the platform, I think 64 is a > limitation of x window. > > Julien > > Le 13 juil. 2009 à 23:46, Andi Clemens <[hidden email]> a > > écrit : > > SVN commit 996141 by aclemens: > > > > I would suggest to display the draw cursor all the time, so it is > > easier to set the correct size in the panel. > > Right now we show the cursor only when pressing the mouse. > > > > One question: Why do we allow to set a size of 100 in the panel for > > the > > brush size, but disallow the maximum size in the mouseMoveEvent? > > In there we only allow a max size of 64, which looks weird, because > > the > > mask "blob" we draw is bigger as the cursor. > > > > Is this some old, "wrong" code? > > > > Andi > > > > CCMAIL:[hidden email] > > > > M +7 -4 imageguidewidget.cpp > > > > > > --- trunk/extragear/graphics/digikam/libs/widgets/imageplugins/ > > imageguidewidget.cpp #996140:996141 > > @@ -720,7 +720,7 @@ > > d->spot.setX(e->x()-d->rect.x()); > > d->spot.setY(e->y()-d->rect.y()); > > } > > - else if ((e->buttons() & Qt::LeftButton) && d->drawingMask) > > + else if (d->enableDrawMask) > > { > > int size = d->penWidth; > > if (size>64) > > @@ -731,9 +731,12 @@ > > p.drawEllipse( 0, 0, size-1, size-1); > > setCursor(QCursor(pix)); > > > > - QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y()-d- > > > > >rect.y()); > > > > - drawLineTo(currentPos); > > - updatePreview(); > > + if ((e->buttons() & Qt::LeftButton) && d->drawingMask) > > + { > > + QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y > > ()-d->rect.y()); > > + drawLineTo(currentPos); > > + updatePreview(); > > + } > > } > > } > > else > > _______________________________________________ > > Digikam-devel mailing list > > [hidden email] > > https://mail.kde.org/mailman/listinfo/digikam-devel > > _______________________________________________ > Digikam-devel mailing list > [hidden email] > https://mail.kde.org/mailman/listinfo/digikam-devel _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
|
Hmm ok the cursor seems to work best in 32x32, and max seems to be 64x64 on
some systems. I guess we can't do anything... ;-( Andi On Tuesday 14 July 2009 10:29:44 Andi Clemens wrote: > Really? But why is it working in Gimp and Krita? > Ok Gimp is GTK, but Krita uses KDE / Qt, too, they don't have such > limitations. > > Andi > > On Tuesday 14 July 2009 08:55:19 Julien Narboux wrote: > > Hi andi > > > > The limitation of the size of the cursor was made on purpose. When I > > tried a size bigger than 64 the drawing of the cursor was broken: I > > had some artefacts. It may depend on the platform, I think 64 is a > > limitation of x window. > > > > Julien > > > > Le 13 juil. 2009 à 23:46, Andi Clemens <[hidden email]> a > > > > écrit : > > > SVN commit 996141 by aclemens: > > > > > > I would suggest to display the draw cursor all the time, so it is > > > easier to set the correct size in the panel. > > > Right now we show the cursor only when pressing the mouse. > > > > > > One question: Why do we allow to set a size of 100 in the panel for > > > the > > > brush size, but disallow the maximum size in the mouseMoveEvent? > > > In there we only allow a max size of 64, which looks weird, because > > > the > > > mask "blob" we draw is bigger as the cursor. > > > > > > Is this some old, "wrong" code? > > > > > > Andi > > > > > > CCMAIL:[hidden email] > > > > > > M +7 -4 imageguidewidget.cpp > > > > > > > > > --- trunk/extragear/graphics/digikam/libs/widgets/imageplugins/ > > > imageguidewidget.cpp #996140:996141 > > > @@ -720,7 +720,7 @@ > > > d->spot.setX(e->x()-d->rect.x()); > > > d->spot.setY(e->y()-d->rect.y()); > > > } > > > - else if ((e->buttons() & Qt::LeftButton) && d->drawingMask) > > > + else if (d->enableDrawMask) > > > { > > > int size = d->penWidth; > > > if (size>64) > > > @@ -731,9 +731,12 @@ > > > p.drawEllipse( 0, 0, size-1, size-1); > > > setCursor(QCursor(pix)); > > > > > > - QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y()-d- > > > > > > >rect.y()); > > > > > > - drawLineTo(currentPos); > > > - updatePreview(); > > > + if ((e->buttons() & Qt::LeftButton) && d->drawingMask) > > > + { > > > + QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y > > > ()-d->rect.y()); > > > + drawLineTo(currentPos); > > > + updatePreview(); > > > + } > > > } > > > } > > > else > > > _______________________________________________ > > > Digikam-devel mailing list > > > [hidden email] > > > https://mail.kde.org/mailman/listinfo/digikam-devel > > > > _______________________________________________ > > Digikam-devel mailing list > > [hidden email] > > https://mail.kde.org/mailman/listinfo/digikam-devel > > _______________________________________________ > Digikam-devel mailing list > [hidden email] > https://mail.kde.org/mailman/listinfo/digikam-devel _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
|
I do not know for sure, but I think the only solution is to draw a
circle by hand at the current position of the cursor and not use the functions to change the cursor... Julien Le 14 juil. 2009 à 16:28, Andi Clemens <[hidden email]> a écrit : > Hmm ok the cursor seems to work best in 32x32, and max seems to be > 64x64 on > some systems. > I guess we can't do anything... ;-( > > Andi > > On Tuesday 14 July 2009 10:29:44 Andi Clemens wrote: >> Really? But why is it working in Gimp and Krita? >> Ok Gimp is GTK, but Krita uses KDE / Qt, too, they don't have such >> limitations. >> >> Andi >> >> On Tuesday 14 July 2009 08:55:19 Julien Narboux wrote: >>> Hi andi >>> >>> The limitation of the size of the cursor was made on purpose. When I >>> tried a size bigger than 64 the drawing of the cursor was broken: I >>> had some artefacts. It may depend on the platform, I think 64 is a >>> limitation of x window. >>> >>> Julien >>> >>> Le 13 juil. 2009 à 23:46, Andi Clemens <[hidden email]> a >>> >>> écrit : >>>> SVN commit 996141 by aclemens: >>>> >>>> I would suggest to display the draw cursor all the time, so it is >>>> easier to set the correct size in the panel. >>>> Right now we show the cursor only when pressing the mouse. >>>> >>>> One question: Why do we allow to set a size of 100 in the panel for >>>> the >>>> brush size, but disallow the maximum size in the mouseMoveEvent? >>>> In there we only allow a max size of 64, which looks weird, because >>>> the >>>> mask "blob" we draw is bigger as the cursor. >>>> >>>> Is this some old, "wrong" code? >>>> >>>> Andi >>>> >>>> CCMAIL:[hidden email] >>>> >>>> M +7 -4 imageguidewidget.cpp >>>> >>>> >>>> --- trunk/extragear/graphics/digikam/libs/widgets/imageplugins/ >>>> imageguidewidget.cpp #996140:996141 >>>> @@ -720,7 +720,7 @@ >>>> d->spot.setX(e->x()-d->rect.x()); >>>> d->spot.setY(e->y()-d->rect.y()); >>>> } >>>> - else if ((e->buttons() & Qt::LeftButton) && d- >>>> >drawingMask) >>>> + else if (d->enableDrawMask) >>>> { >>>> int size = d->penWidth; >>>> if (size>64) >>>> @@ -731,9 +731,12 @@ >>>> p.drawEllipse( 0, 0, size-1, size-1); >>>> setCursor(QCursor(pix)); >>>> >>>> - QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y >>>> ()-d- >>>> >>>>> rect.y()); >>>> >>>> - drawLineTo(currentPos); >>>> - updatePreview(); >>>> + if ((e->buttons() & Qt::LeftButton) && d->drawingMask) >>>> + { >>>> + QPoint currentPos = QPoint(e->x()-d->rect.x(), e- >>>> >y >>>> ()-d->rect.y()); >>>> + drawLineTo(currentPos); >>>> + updatePreview(); >>>> + } >>>> } >>>> } >>>> else >>>> _______________________________________________ >>>> Digikam-devel mailing list >>>> [hidden email] >>>> https://mail.kde.org/mailman/listinfo/digikam-devel >>> >>> _______________________________________________ >>> Digikam-devel mailing list >>> [hidden email] >>> https://mail.kde.org/mailman/listinfo/digikam-devel >> >> _______________________________________________ >> Digikam-devel mailing list >> [hidden email] >> https://mail.kde.org/mailman/listinfo/digikam-devel > > _______________________________________________ > Digikam-devel mailing list > [hidden email] > https://mail.kde.org/mailman/listinfo/digikam-devel Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
|
I did this already, but then the circle will be seen forever :)
Sure we could add a dedicated pixmap for that and clear it on every update, but I tried this and it is too slow. I guess users will have to live with this now, some day we might use a QGraphicsScene, which is much more optimized for speed. Andi On Tuesday 14 July 2009 16:49:59 Julien Narboux wrote: > I do not know for sure, but I think the only solution is to draw a > circle by hand at the current position of the cursor and not use the > functions to change the cursor... > > Julien > > > Le 14 juil. 2009 à 16:28, Andi Clemens <[hidden email]> a > > écrit : > > Hmm ok the cursor seems to work best in 32x32, and max seems to be > > 64x64 on > > some systems. > > I guess we can't do anything... ;-( > > > > Andi > > > > On Tuesday 14 July 2009 10:29:44 Andi Clemens wrote: > >> Really? But why is it working in Gimp and Krita? > >> Ok Gimp is GTK, but Krita uses KDE / Qt, too, they don't have such > >> limitations. > >> > >> Andi > >> > >> On Tuesday 14 July 2009 08:55:19 Julien Narboux wrote: > >>> Hi andi > >>> > >>> The limitation of the size of the cursor was made on purpose. When I > >>> tried a size bigger than 64 the drawing of the cursor was broken: I > >>> had some artefacts. It may depend on the platform, I think 64 is a > >>> limitation of x window. > >>> > >>> Julien > >>> > >>> Le 13 juil. 2009 à 23:46, Andi Clemens <[hidden email]> a > >>> > >>> écrit : > >>>> SVN commit 996141 by aclemens: > >>>> > >>>> I would suggest to display the draw cursor all the time, so it is > >>>> easier to set the correct size in the panel. > >>>> Right now we show the cursor only when pressing the mouse. > >>>> > >>>> One question: Why do we allow to set a size of 100 in the panel for > >>>> the > >>>> brush size, but disallow the maximum size in the mouseMoveEvent? > >>>> In there we only allow a max size of 64, which looks weird, because > >>>> the > >>>> mask "blob" we draw is bigger as the cursor. > >>>> > >>>> Is this some old, "wrong" code? > >>>> > >>>> Andi > >>>> > >>>> CCMAIL:[hidden email] > >>>> > >>>> M +7 -4 imageguidewidget.cpp > >>>> > >>>> > >>>> --- trunk/extragear/graphics/digikam/libs/widgets/imageplugins/ > >>>> imageguidewidget.cpp #996140:996141 > >>>> @@ -720,7 +720,7 @@ > >>>> d->spot.setX(e->x()-d->rect.x()); > >>>> d->spot.setY(e->y()-d->rect.y()); > >>>> } > >>>> - else if ((e->buttons() & Qt::LeftButton) && d- > >>>> > >>>> >drawingMask) > >>>> > >>>> + else if (d->enableDrawMask) > >>>> { > >>>> int size = d->penWidth; > >>>> if (size>64) > >>>> @@ -731,9 +731,12 @@ > >>>> p.drawEllipse( 0, 0, size-1, size-1); > >>>> setCursor(QCursor(pix)); > >>>> > >>>> - QPoint currentPos = QPoint(e->x()-d->rect.x(), e->y > >>>> ()-d- > >>>> > >>>>> rect.y()); > >>>> > >>>> - drawLineTo(currentPos); > >>>> - updatePreview(); > >>>> + if ((e->buttons() & Qt::LeftButton) && d->drawingMask) > >>>> + { > >>>> + QPoint currentPos = QPoint(e->x()-d->rect.x(), e- > >>>> > >>>> >y > >>>> > >>>> ()-d->rect.y()); > >>>> + drawLineTo(currentPos); > >>>> + updatePreview(); > >>>> + } > >>>> } > >>>> } > >>>> else > >>>> _______________________________________________ > >>>> Digikam-devel mailing list > >>>> [hidden email] > >>>> https://mail.kde.org/mailman/listinfo/digikam-devel > >>> > >>> _______________________________________________ > >>> Digikam-devel mailing list > >>> [hidden email] > >>> https://mail.kde.org/mailman/listinfo/digikam-devel > >> > >> _______________________________________________ > >> Digikam-devel mailing list > >> [hidden email] > >> https://mail.kde.org/mailman/listinfo/digikam-devel > > > > _______________________________________________ > > Digikam-devel mailing list > > [hidden email] > > https://mail.kde.org/mailman/listinfo/digikam-devel > > _______________________________________________ > Digikam-devel mailing list > [hidden email] > https://mail.kde.org/mailman/listinfo/digikam-devel _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
| Free forum by Nabble | Edit this page |
