mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 14:03:17 +02:00
Fix typeid warning
This commit is contained in:
parent
cb758ca6b4
commit
a455cb880f
1 changed files with 4 additions and 6 deletions
|
@ -533,15 +533,13 @@ bool Overlays::isLoaded(unsigned int id) {
|
|||
QSizeF Overlays::textSize(unsigned int id, const QString& text) const {
|
||||
Overlay::Pointer thisOverlay = _overlaysHUD[id];
|
||||
if (thisOverlay) {
|
||||
if (typeid(*thisOverlay) == typeid(TextOverlay)) {
|
||||
return std::dynamic_pointer_cast<TextOverlay>(thisOverlay)->textSize(text);
|
||||
if (auto textOverlay = std::dynamic_pointer_cast<TextOverlay>(thisOverlay)) {
|
||||
return textOverlay->textSize(text);
|
||||
}
|
||||
} else {
|
||||
thisOverlay = _overlaysWorld[id];
|
||||
if (thisOverlay) {
|
||||
if (typeid(*thisOverlay) == typeid(Text3DOverlay)) {
|
||||
return std::dynamic_pointer_cast<Text3DOverlay>(thisOverlay)->textSize(text);
|
||||
}
|
||||
if (auto text3dOverlay = std::dynamic_pointer_cast<Text3DOverlay>(thisOverlay)) {
|
||||
return text3dOverlay->textSize(text);
|
||||
}
|
||||
}
|
||||
return QSizeF(0.0f, 0.0f);
|
||||
|
|
Loading…
Reference in a new issue