mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
VizFwk compiler fixes for VS2010
This commit is contained in:
parent
fff68b3ea6
commit
db9b225112
@ -281,8 +281,7 @@ BoundingBox DrawableText::boundingBox() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::BoundingBox
|
||||
DrawableText::textBoundingBox(const String& text, const Vec3f& position, const Vec3f& direction /*= Vec3f::X_AXIS*/)
|
||||
cvf::BoundingBox DrawableText::textBoundingBox(const String& text, const Vec3f& position, const Vec3f& direction /*= Vec3f::X_AXIS*/)
|
||||
{
|
||||
ref<Glyph> glyph = m_font->getGlyph(L'A');
|
||||
Vec2f textExtent(m_font->textExtent(text));
|
||||
@ -291,10 +290,10 @@ cvf::BoundingBox
|
||||
float glyphMarginY = 0.25f * static_cast<float>(glyph->height());
|
||||
|
||||
BoundingBox textBox;
|
||||
std::array<Vec3f, 4> corners =
|
||||
TextDrawer::textCorners(*glyph, cvf::Vec2f::ZERO, textExtent, verticalAlignment, direction, glyphMarginX, glyphMarginY);
|
||||
for (const Vec3f& corner : corners)
|
||||
std::array<Vec3f, 4> corners = TextDrawer::textCorners(*glyph, cvf::Vec2f::ZERO, textExtent, verticalAlignment, direction, glyphMarginX, glyphMarginY);
|
||||
for (size_t i = 0; i < corners.size(); i++)
|
||||
{
|
||||
const Vec3f& corner = corners[i];
|
||||
textBox.add(position + corner);
|
||||
}
|
||||
return textBox;
|
||||
|
@ -698,8 +698,7 @@ short TextDrawer::calculateVerticalAlignmentOffset(Font& font, Alignment alignme
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::array<cvf::Vec3f, 4>
|
||||
TextDrawer::textCorners(const Glyph& glyph, const Vec2f& textStart, const Vec2f& textExtent, short verticalAlignment, const Vec3f& textDirection, float marginX, float marginY)
|
||||
std::array<cvf::Vec3f, 4> TextDrawer::textCorners(const Glyph& glyph, const Vec2f& textStart, const Vec2f& textExtent, short verticalAlignment, const Vec3f& textDirection, float marginX, float marginY)
|
||||
{
|
||||
Vec3f tangent = textDirection;
|
||||
if (tangent.x() < 0.0f) tangent *= -1.0f;
|
||||
@ -721,7 +720,9 @@ std::array<cvf::Vec3f, 4>
|
||||
// Upper left corner
|
||||
Vec3f c4 = tangent * x1 + normal * y2;
|
||||
|
||||
return { c1, c2, c3, c4 };
|
||||
|
||||
std::array<cvf::Vec3f, 4> retArr = { c1, c2, c3, c4 };
|
||||
return retArr;
|
||||
}
|
||||
|
||||
} // namespace cvf
|
||||
|
Loading…
Reference in New Issue
Block a user