Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Your Open Source Java OpenGL GUI. Interactive user interfaces for games or similar applications. LWJGL, JOGL, JME or Java2d rendering.
Java Other

fix(Java2D): Initialize graphics and graphics2dHelper in constructor

Both were initialized lazily in the beginFrame() method which is only
called when rendering Nifty. Therefore it was possible that the graphics
and graphics2dHelper member variables were null before the first call of
nifty.render(). However for getting RenderFont attributes (like the
width) the Java2D implementation required the graphics instance!

But it is very likely that you call fromXml() before the very first
frame being renderedn and you'd end up with a none-initialized graphics
member variable and therefore a font.getWidth() call returns 0.

I think this lead to a lot of issues one reported was that wrap="true"
did not work unless render() was called at least once.

So this commit will init both variables directly in the constructor
fixing this!

fix #317 wrap="true" does not work in Java2D renderer
latest commit 4d95288b5d
void authored
Failed to load latest commit information.
nifty-controls-style-black [maven-release-plugin] prepare for next development iteration
nifty-controls [maven-release-plugin] prepare for next development iteration
nifty-core Update SinusPulsator to accept "reverse" parameter
nifty-examples-jogl [maven-release-plugin] prepare for next development iteration
nifty-examples-libgdx [maven-release-plugin] prepare for next development iteration
nifty-examples-lwjgl [maven-release-plugin] prepare for next development iteration
nifty-examples-slick2d [maven-release-plugin] prepare for next development iteration
nifty-examples [maven-release-plugin] prepare for next development iteration
nifty-html [maven-release-plugin] prepare for next development iteration
nifty-renderer-java2d fix(Java2D): Initialize graphics and graphics2dHelper in constructor
nifty-renderer-jogl [maven-release-plugin] prepare for next development iteration
nifty-renderer-libgdx [maven-release-plugin] prepare for next development iteration
nifty-renderer-lwjgl [maven-release-plugin] prepare for next development iteration
nifty-renderer-slick2d [maven-release-plugin] prepare for next development iteration
nifty-soundsystem-openal [maven-release-plugin] prepare for next development iteration
nifty-soundsystem-pauls-sound [maven-release-plugin] prepare for next development iteration
.gitignore added bin/ to .gitignore
README.md Update README.md
license.txt license.txt added (2-clause "FreeBSD License" as stated in the pom.xml)
nifty-gui-private.asc use pgp-maven-plugin instead of gpg-maven-plugin for release signing
nifty-gui-public.asc use pgp-maven-plugin instead of gpg-maven-plugin for release signing
pom.xml [maven-release-plugin] prepare for next development iteration

README.md

Nifty GUI

TODO

Stories in Ready

Throughput Graph

Something went wrong with that request. Please try again.