mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
As creation of a font is time consuming, create one application font instance
p4#: 21338
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cvfScalarMapperDiscreteLog.h"
|
||||
#include "RiaApplication.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimLegendConfig, "Legend");
|
||||
|
||||
@@ -92,9 +93,8 @@ RimLegendConfig::RimLegendConfig()
|
||||
|
||||
m_currentScalarMapper = m_linDiscreteScalarMapper;
|
||||
|
||||
|
||||
cvf::FixedAtlasFont* font = new cvf::FixedAtlasFont(cvf::FixedAtlasFont::STANDARD);
|
||||
m_legend = new cvf::OverlayScalarMapperLegend(font);
|
||||
cvf::Font* standardFont = RiaApplication::instance()->standardFont();
|
||||
m_legend = new cvf::OverlayScalarMapperLegend(standardFont);
|
||||
m_position = cvf::Vec2ui(20, 50);
|
||||
|
||||
updateFieldVisibility();
|
||||
@@ -394,8 +394,8 @@ void RimLegendConfig::recreateLegend()
|
||||
// has been removed, (and thus the opengl resources has been deleted) The text in
|
||||
// the legend disappeared because of this, so workaround: recreate the legend when needed:
|
||||
|
||||
cvf::FixedAtlasFont* font = new cvf::FixedAtlasFont(cvf::FixedAtlasFont::STANDARD);
|
||||
m_legend = new cvf::OverlayScalarMapperLegend(font);
|
||||
cvf::Font* standardFont = RiaApplication::instance()->standardFont();
|
||||
m_legend = new cvf::OverlayScalarMapperLegend(standardFont);
|
||||
|
||||
updateLegend();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user