Skip to content

Commit

Permalink
fixup! AnnotationsGadget : Add annotationAt()
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Feb 7, 2025
1 parent 47d3d4f commit 1d8a888
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/GafferUI/AnnotationsGadget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 1d8a888

Please sign in to comment.