mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Set background and frame color from the view plus update frame margins.
This commit is contained in:
@@ -734,30 +734,8 @@ cvf::Vec3f RivGridBoxGenerator::cornerDirection(FaceType face1, FaceType face2)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivGridBoxGenerator::updateFromBackgroundColor(const cvf::Color3f& backgroundColor)
|
||||
{
|
||||
double adjustmentFactor = 0.3;
|
||||
|
||||
float gridR = 0.0;
|
||||
float gridG = 0.0;
|
||||
float gridB = 0.0;
|
||||
|
||||
if (RiaColorTools::isBrightnessAboveThreshold(backgroundColor))
|
||||
{
|
||||
gridR = backgroundColor.r() - (backgroundColor.r() * adjustmentFactor);
|
||||
gridG = backgroundColor.g() - (backgroundColor.g() * adjustmentFactor);
|
||||
gridB = backgroundColor.b() - (backgroundColor.b() * adjustmentFactor);
|
||||
|
||||
m_gridLegendColor = RiaColorTools::darkContrastColor();
|
||||
}
|
||||
else
|
||||
{
|
||||
gridR = backgroundColor.r() + (1.0 - backgroundColor.r()) * adjustmentFactor;
|
||||
gridG = backgroundColor.g() + (1.0 - backgroundColor.g()) * adjustmentFactor;
|
||||
gridB = backgroundColor.b() + (1.0 - backgroundColor.b()) * adjustmentFactor;
|
||||
|
||||
m_gridLegendColor = RiaColorTools::brightContrastColor();
|
||||
}
|
||||
|
||||
m_gridColor.set(gridR, gridG, gridB);
|
||||
m_gridColor = RiaColorTools::computeOffsetColor(backgroundColor, 0.3f);
|
||||
m_gridLegendColor = RiaColorTools::constrastColor(backgroundColor);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -118,7 +118,7 @@ void RivTernarySaturationOverlayItem::renderGeneric(cvf::OpenGLContext* oglConte
|
||||
this->backgroundColor(),
|
||||
this->backgroundFrameColor());
|
||||
}
|
||||
border = 3.0f;
|
||||
border = 8.0f;
|
||||
}
|
||||
|
||||
cvf::TextDrawer textDrawer(this->font());
|
||||
@@ -126,7 +126,7 @@ void RivTernarySaturationOverlayItem::renderGeneric(cvf::OpenGLContext* oglConte
|
||||
|
||||
float lineHeightInPixels = (float)(this->font()->textExtent("SWAT").y() + 2);
|
||||
|
||||
float textPosY = static_cast<float>(size.y() - lineHeightInPixels);
|
||||
float textPosY = static_cast<float>(size.y() - lineHeightInPixels - border);
|
||||
for (size_t it = 0; it < this->titleStrings().size(); it++)
|
||||
{
|
||||
cvf::Vec2f pos(border, textPosY);
|
||||
|
||||
Reference in New Issue
Block a user