aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-13 23:20:12 +0100
committerSven Göthel <[email protected]>2024-02-13 23:20:12 +0100
commit00b140e39d0181bc2f41500c1797108157e30164 (patch)
treecd584278124d92990af42a69e6e8c6545e879f10
parent949676fb8cac4d6aa626a375501e41a65a1a11fa (diff)
GraphUI Demo FontView01: Re-Enable snapshot via 's'
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java
index 2035c39cc..8409ac252 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java
@@ -219,6 +219,7 @@ public class FontView01 {
System.err.println(gridDim);
System.err.println("GlyphGrid[pgsz "+glyphGridSize+", totsz "+glyphGridTotalSize+", cellSz "+glyphGridCellSize+"]");
+ final int[] lastCodepoint = { gridDim.contourChars.get(0) };
final Group mainView;
final Shape.PointerListener glyphPointerListener;
{
@@ -241,13 +242,12 @@ public class FontView01 {
e.setConsumed(true);
// Selected Glyph g0
- final boolean doScreenshot = e.isControlDown() && e.getButtonDownCount() > 0;
scene.invoke(false, (final GLAutoDrawable d) -> {
// Handle old one
if( 1 == glyphShapeHolder.getShapeCount() ) {
final GlyphShape old = (GlyphShape) glyphShapeHolder.getShapeByIdx(0);
if( null != old ) {
- if( !doScreenshot && old.getGlyph().getCodepoint() == g0.getGlyph().getCodepoint() ) {
+ if( old.getGlyph().getCodepoint() == g0.getGlyph().getCodepoint() ) {
// System.err.println("GlyphShape Same: "+old);
return true; // abort - no change
} else {
@@ -262,9 +262,7 @@ public class FontView01 {
// New Glyph
glyphShapeHolder.addShape(g0);
setGlyphInfo(fontStatus, glyphInfo, g0.getGlyph());
- if( doScreenshot ) {
- printScreenOnGLThread(scene, window.getChosenGLCapabilities(), font, g0.getGlyph().getCodepoint());
- }
+ lastCodepoint[0] = g0.getGlyph().getCodepoint();
return true;
});
};
@@ -398,6 +396,8 @@ public class FontView01 {
final short keySym = e.getKeySymbol();
if( keySym == KeyEvent.VK_F4 || keySym == KeyEvent.VK_ESCAPE || keySym == KeyEvent.VK_Q ) {
MiscUtils.destroyWindow(window);
+ } else if( keySym == KeyEvent.VK_S ) {
+ printScreenOnGLThread(scene, window.getChosenGLCapabilities(), font, lastCodepoint[0]);
}
}
});
@@ -419,7 +419,7 @@ public class FontView01 {
final float nsPerGlyph = total / gridDim.glyphCount;
System.err.println("PERF: Total took "+(total/1000000.0)+"ms, per-glyph "+(nsPerGlyph/1000000.0)+"ms, glyphs "+gridDim.glyphCount);
}
- printScreenOnGLThread(scene, window.getChosenGLCapabilities(), font, gridDim.contourChars.get(0));
+ printScreenOnGLThread(scene, window.getChosenGLCapabilities(), font, lastCodepoint[0]);
// stay open ..
OutlineShape.printPerf(System.err);
}