aboutsummaryrefslogtreecommitdiffstats
path: root/src/demos/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-22 08:37:26 +0100
committerSven Göthel <[email protected]>2024-01-22 08:37:26 +0100
commit6c11c32f4081e9029eeed281d317894bd179f1e3 (patch)
tree7b338bf48fb698aac9e71a638920c4b22a4947af /src/demos/com/jogamp/opengl
parent6cf158cc59e901b49ab54681e363d23492421a9d (diff)
Simplify TooltipShape: Create own wrapper Group to not mutate user given Shape (if reused in DAG); Fix FontView01 TooltipShape instance, use NoOp DestroyCallback
Diffstat (limited to 'src/demos/com/jogamp/opengl')
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java9
1 files changed, 3 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 546362990..cd81bb851 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java
@@ -504,6 +504,7 @@ public class FontView01 {
final GlyphShape g = new GlyphShape(options.renderModes, fg, 0, 0);
g.setColor(0.1f, 0.1f, 0.1f, 1).setName("GlyphShape");
g.setInteractive(false).setDragAndResizeable(false);
+ g.setName( "cp_0x"+Integer.toHexString(fg.getCodepoint()) );
final Group c0 = new Group("GlyphHolder", null, null, g);
c0.setInteractive(false).setDragAndResizeable(false);
@@ -523,12 +524,8 @@ public class FontView01 {
sink.receiveKeyEvents(c1);
// sink.receiveMouseEvents(c1);
c1.setToolTip( new TooltipShape(new Vec4f(1, 1, 1, 1), new Vec4f(0, 0, 0, 1), 0.01f,
- new Vec2f(14,14), 1000, options.renderModes,
- new Group("GlyphTipGroup", null, null, g).setPaddding(new Padding(0.05f)),
- (final GL2ES2 gl, final RegionRenderer renderer, final Shape ts) -> {
- ((Group)ts).removeShape(g);
- ts.destroy(gl, renderer);
- } ) );
+ new Padding(0.05f), new Vec2f(14,14), 1000, options.renderModes,
+ g, TooltipShape.NoOpDtor) );
c1.onClicked((final Shape s) -> {
c1.getTooltip().now();
});