Tracker: Patches

5 antialiased MemoryStatus - ID: 2646789
Last Update: Settings changed ( shlomy )

Makes the text in MemoryStatus be smoothed via usage of the Graphics2D
painter.


Gordon Hollenbeck ( gordon1986 ) - 2009-02-27 22:28

5

Open

None

Nobody/Anonymous

texteditor

None

Public


Comments ( 2 )

Date: 2009-08-18 08:16
Sender: shlomy

I never messed with any antialiasing settings, maybe Matthieu did.
I took a look at the patch anyway, and although I am not familiar with
Graphics, two things seem to be wrong:
1. The assumption that the passed Graphics object is always a Graphics2D -
I assume this depends on some settings, but this is not my area of
expertise so I may be wrong. At least there should be an "instanceof" check
to verify.
2. The patch gets rid of the creation of new Graphics objects, and
operates directly on the given object. According to the documentation,
paintComponent should not make any permanent changes to the Graphics
object:
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComponent.html#paintComponent%28java.awt.Graphics%29
And the patch actually does, it sets the clipping of the object.

I think it should be safe to keep the previous behavior (where copies of
the Graphics object are made), check "instanceof" on the copy, to verify
that it's Graphics2D, and then set the rendering hints on the copy.

One other thing - I recommend to avoid including non-related changes in
such patches, e.g. this one has lots of whitespace corrections, which makes
me have to go through a lot more than just the 2-3 lines that are actually
changed.


Date: 2009-08-18 06:24
Sender: ezustProject AdminAccepting Donations

shlomy, please review? I seem to recall you were fixing up other aspects of
the gutter/statusbar's antialiasing settings...



Attached File ( 1 )

Filename Description Download
memory_status_widget.diff Patch to enable font smoothing for MemoryStatus Download

Changes ( 3 )

Field Old Value Date By
assigned_to shlomy 2009-08-18 08:17 shlomy
assigned_to nobody 2009-08-18 06:24 ezust
File Added 315488: memory_status_widget.diff 2009-02-27 22:28 gordon1986