GoogleCodeArchive / piccolo2d

Automatically exported from code.google.com/p/piccolo2d
0 stars 0 forks source link

PSwing are fuzzy when scale!=1, due to buffering of the PSwing #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Running TestPSwing and setting pCanvas.getLayer().scale(0.98); after
creation of the PSwingCanvas
2. Using the PSwing-nobuffer.java (see attached) resolves the problem

See attached images for the buffered and unbuffered versions.

Original issue reported on code.google.com by samrr...@gmail.com on 7 May 2009 at 8:36

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by heue...@gmail.com on 15 May 2009 at 6:33

GoogleCodeExporter commented 9 years ago

Original comment by heue...@gmail.com on 15 May 2009 at 6:38

GoogleCodeExporter commented 9 years ago

Original comment by heue...@gmail.com on 15 May 2009 at 7:49

GoogleCodeExporter commented 9 years ago
If there's no good reason for having the buffering in PSwing, I can't see why 
it's
not taken out.

If no-one has objections, I'll take the buffering code and take it out, or at 
least
make it optional.

Original comment by allain.lalonde on 14 Jul 2009 at 5:19

GoogleCodeExporter commented 9 years ago
My team and I tried removing buffering from PSwing; however, it caused a 
problem that
some swing components (buttons, labels, etc) rendered with a '...' on Mac.  
That is,
instead of a button reading "Press Me", on a Mac, some unbuffered PSwings would 
read
something like "Press M...".  So we have re-enabled buffering in PSwing in our 
local
copy and recommend not disabling buffering until this problem is resolved.

Original comment by samrr...@gmail.com on 14 Jul 2009 at 5:22

GoogleCodeExporter commented 9 years ago
Allain, 
I paste your code snippt here where I can link to and set ma a reminder (and 
still
getting my inbox clear):

I'll try out the following code snippet within the next week:

  public void paint(Graphics2D g2) {
       if (component.getBounds().isEmpty()) {
           // The component has not been initialized yet.
           return;
       }

       PSwingRepaintManager manager = (PSwingRepaintManager)
RepaintManager.currentManager(component);
       manager.lockRepaint(component);

       RenderingHints oldHints = g2.getRenderingHints();

       g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,

RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
       component.paint(g2);

       g2.setRenderingHints(oldHints);

       manager.unlockRepaint(component);
   }

Original comment by mr0...@mro.name on 14 Jul 2009 at 3:11

GoogleCodeExporter commented 9 years ago
oh, my tyginp - a mess!

Original comment by mr0...@mro.name on 14 Jul 2009 at 3:13

GoogleCodeExporter commented 9 years ago
tyginp? not following.

Original comment by allain.lalonde on 14 Jul 2009 at 3:21

GoogleCodeExporter commented 9 years ago
Oh, just got it. no worries.

Original comment by allain.lalonde on 14 Jul 2009 at 3:22

GoogleCodeExporter commented 9 years ago
Received Email confirmation from Chris Malley and permission to push by Samuel.

Original comment by allain.lalonde on 14 Jul 2009 at 8:33

GoogleCodeExporter commented 9 years ago
Should probably get confirmation from a couple more mac users before declaring 
this one 
dead.

Original comment by allain.lalonde on 14 Jul 2009 at 8:38

GoogleCodeExporter commented 9 years ago
Sorry, forgot to put in the revision that fixed it: r467

Original comment by allain.lalonde on 14 Jul 2009 at 8:39

GoogleCodeExporter commented 9 years ago
Seems that the fractional font metrics are required for smooth zooming on 
windows. Can 
someone with a mac tell us if the text "jumps" from one font size to another 
when 
zooming rather than smoothly transitioning.

I'm re-opening it since there are problems with the windows controls now if the 
fractional fonts are disallowed.

Original comment by allain.lalonde on 16 Jul 2009 at 1:53

GoogleCodeExporter commented 9 years ago
Honestly - I don't get how to try this out - there's no demonstrating class in 
the
project yet, right?

Original comment by mr0...@mro.name on 18 Jul 2009 at 1:04

GoogleCodeExporter commented 9 years ago
PSwingExample1 in the examples project would do.

Original comment by allain.lalonde on 18 Jul 2009 at 1:23

GoogleCodeExporter commented 9 years ago
great, I added a 

        pCanvas.getCamera().scale(0.98f);

at line 171 - the result looks great to me. Shots attached.

Original comment by mr0...@mro.name on 18 Jul 2009 at 2:10

Attachments:

GoogleCodeExporter commented 9 years ago
While zooming the whole display content flickers a bit and the text placement 
seems
to hop sometimes - but not more than one pixel as far as i can see.

I'd record a screencast, but don't know how to do that.

Altogether the result looks well acceptable to me.

Tested on a macbook, OS X 10.5.7, 
$ java -version
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
Java HotSpot(TM) Client VM (build 1.5.0_19-137, mixed mode, sharing)

Original comment by mr0...@mro.name on 18 Jul 2009 at 3:16

GoogleCodeExporter commented 9 years ago
Fixed in r550 (hopefully for the last time... grumble grumble)

Original comment by allain.lalonde on 23 Jul 2009 at 3:43

GoogleCodeExporter commented 9 years ago

Original comment by allain.lalonde on 4 Aug 2009 at 1:31

GoogleCodeExporter commented 9 years ago

Original comment by heue...@gmail.com on 21 Oct 2009 at 2:43

GoogleCodeExporter commented 9 years ago
Re-opening due to recent rollback

Original comment by allain.lalonde on 23 Oct 2009 at 9:40

GoogleCodeExporter commented 9 years ago
Fixed in revision 863.

Original comment by allain.lalonde on 29 Oct 2009 at 9:10

GoogleCodeExporter commented 9 years ago

Original comment by allain.lalonde on 29 Oct 2009 at 9:10

GoogleCodeExporter commented 9 years ago
Looks good to me on Mac OSX 10.5.8 PPC

$ java -version
java version "1.5.0_20"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_20-b02-315)
Java HotSpot(TM) Client VM (build 1.5.0_20-141, mixed mode, sharing)

Original comment by heue...@gmail.com on 4 Nov 2009 at 7:46