Fix label size and text bounding box

This commit is contained in:
Georg Hagen
2025-01-13 23:46:05 +01:00
parent 2b87ed58b2
commit 968fa5a735
2 changed files with 5 additions and 7 deletions

View File

@@ -105,9 +105,9 @@ namespace OpenVulkano::Scene
Math::Vector2f padding = m_settings.padding * 2;
if (m_settings.hasArrow) padding.y += m_settings.arrowLength;
m_labelData.textSize = Math::Vector2f(m_bbox.GetSize()) + padding * 2;
m_labelData.bboxCenter = { m_bbox.GetCenter() };
if (m_settings.hasArrow) m_labelData.bboxCenter.y -= m_settings.arrowLength;
m_labelData.textSize = m_bbox.GetSize() + padding;
m_labelData.bboxCenter = m_bbox.GetCenter();
if (m_settings.hasArrow) m_labelData.bboxCenter.y -= m_settings.arrowLength * 0.5f;
}
std::optional<RayHit> LabelDrawable::Intersect(const Ray& ray) const