From 1d8a8881348d749ba42ed37e4f09b9a43fe92582 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 7 Feb 2025 15:01:15 -0500 Subject: [PATCH] fixup! AnnotationsGadget : Add `annotationAt()` --- src/GafferUI/AnnotationsGadget.cpp | 31 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/GafferUI/AnnotationsGadget.cpp b/src/GafferUI/AnnotationsGadget.cpp index 192c698006..4bd29454f9 100644 --- a/src/GafferUI/AnnotationsGadget.cpp +++ b/src/GafferUI/AnnotationsGadget.cpp @@ -750,25 +750,28 @@ void AnnotationsGadget::renderAnnotations( const Style *style, AnnotationBufferM } } - if( annotations.bookmarked ) + if( !selectionIds ) { - style->renderImage( Box2f( bookmarkIconPos - V2f( 1.0 ), bookmarkIconPos + V2f( 1.0 ) ), bookmarkTexture() ); - } - - if( annotations.numericBookmark.string().size() ) - { - if( !annotations.bookmarked ) + if( annotations.bookmarked ) { - style->renderImage( Box2f( bookmarkIconPos - V2f( 1.0 ), bookmarkIconPos + V2f( 1.0 ) ), numericBookmarkTexture() ); + style->renderImage( Box2f( bookmarkIconPos - V2f( 1.0 ), bookmarkIconPos + V2f( 1.0 ) ), bookmarkTexture() ); } - const Box3f textBounds = style->textBound( Style::LabelText, annotations.numericBookmark.string() ); + if( annotations.numericBookmark.string().size() ) + { + if( !annotations.bookmarked ) + { + style->renderImage( Box2f( bookmarkIconPos - V2f( 1.0 ), bookmarkIconPos + V2f( 1.0 ) ), numericBookmarkTexture() ); + } + + const Box3f textBounds = style->textBound( Style::LabelText, annotations.numericBookmark.string() ); - const Imath::Color4f textColor( 0.8f ); - glPushMatrix(); - IECoreGL::glTranslate( V2f( bookmarkIconPos.x - 0.9 - textBounds.size().x, bookmarkIconPos.y - textBounds.size().y * 0.5 - 0.2 ) ); - style->renderText( Style::LabelText, annotations.numericBookmark.string(), Style::NormalState, &textColor ); - glPopMatrix(); + const Imath::Color4f textColor( 0.8f ); + glPushMatrix(); + IECoreGL::glTranslate( V2f( bookmarkIconPos.x - 0.9 - textBounds.size().x, bookmarkIconPos.y - textBounds.size().y * 0.5 - 0.2 ) ); + style->renderText( Style::LabelText, annotations.numericBookmark.string(), Style::NormalState, &textColor ); + glPopMatrix(); + } } for( const auto &a : annotations.standardAnnotations )