[Kde-games-devel] Magnifier for Palapeli (patch)

Ian Wadham iandw.au at gmail.com
Sun Aug 22 04:44:42 CEST 2010


Thanks very much for your reply, Stefan.  The magnifier is prototype
code, so has not at this stage included config and other refinements.
That said and should the magnifier prove to be a useful tool ...

On Saturday 21 August 2010 11:19:19 pm Stefan Majewsky wrote:
> On Wednesday 18 August 2010 15:49:12 Ian Wadham wrote:
> Could the toggle action be added to the toolbar?
>
No problem.
 
> > One technical question for Stefan or Johannes ... is it OK to use
> > piece->atomicSize() in the Scene::calculatePieceAreaSize() method,
> > instead of piece->sceneBareBoundingRect().size()?  I need to find the
> > max size of a single piece, even if the puzzle has been partially solved.
> 
> That's exactly the purpose of Piece::atomicSize.
> 
Fine, but I was worried that piece->sceneBareBoundingRect().size()
might have a subtly different effect on the existing code that shuffles or
re-shuffles a puzzle, as opposed to loading a saved puzzle.  It does
not seem to.

> Some more wishes:
> * I would like to be able to change the size of the magnifier (it's a bit
> small for my taste), preferably via the config dialog.
> * The magnifier should IMO disappear when the mouse moves out of the main
> view.
> * When you move the cursor to the border of the sceneRect, and that border
>  is equal to the edge of the view, the magnifier is clipped to the main
>  view. This means that a piece near the border cannot be magnified
>  completely (see screenshot). Could you make it such that the magnifier
>  stays inside the main view's rect() when it comes near the borders?
> 
In principle, no problem with the above, but I am a bit unclear on what or
where the main view is and how the "size" of a piece is determined in the
first place.  I think the main view is the double rectangle that brings up
resize arrows when you move near its edges.  I think the size of a piece
is based on the number of pixels in the original image and the number
of pieces in the puzzle and is measured in pixels.

The magnifier is trying to scale pieces to a typical real-world size, in
millimeters, regardless of the number of pixels.  That should be configurable
and the default should probably be based on the pixel-size of the user's
monitor.  BTW, I find that if the puzzle is a high-res photo cut into six
pieces, the magnifier actually reduces the size of the pieces ... :-)  But
in such a case there is no need of a magnifier ... :-)

All the best, Ian W.


More information about the kde-games-devel mailing list