diff --git a/ApplicationLibCode/Application/RiaPlotDefines.cpp b/ApplicationLibCode/Application/RiaPlotDefines.cpp index 0a7b4d3a74..6ee4a9f171 100644 --- a/ApplicationLibCode/Application/RiaPlotDefines.cpp +++ b/ApplicationLibCode/Application/RiaPlotDefines.cpp @@ -18,6 +18,9 @@ #include "RiaPlotDefines.h" +#include "RiaGuiApplication.h" +#include "RiaPreferencesSystem.h" + #include "cafAppEnum.h" namespace caf @@ -73,3 +76,20 @@ bool RiaDefines::isVertical( RiaDefines::PlotAxis axis ) { return ( axis == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || axis == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RiaDefines::scalingFactor( QPaintDevice* paintDevice ) +{ + auto scalingFactor = RiaPreferencesSystem::current()->exportPdfScalingFactor(); + + if ( scalingFactor > 0.0 ) return scalingFactor; + + if ( !paintDevice ) return 1.0; + + int resolution = paintDevice->logicalDpiX(); + double scaling = resolution / static_cast( RiaGuiApplication::applicationResolution() ); + + return scaling; +} diff --git a/ApplicationLibCode/Application/RiaPlotDefines.h b/ApplicationLibCode/Application/RiaPlotDefines.h index 5eadaf47de..1bbb56cae2 100644 --- a/ApplicationLibCode/Application/RiaPlotDefines.h +++ b/ApplicationLibCode/Application/RiaPlotDefines.h @@ -18,6 +18,8 @@ #pragma once +class QPaintDevice; + // Defines relate to plotting namespace RiaDefines { @@ -36,4 +38,6 @@ double maximumDefaultValuePlot(); bool isHorizontal( PlotAxis axis ); bool isVertical( PlotAxis axis ); +double scalingFactor( QPaintDevice* paintDevice ); + }; // namespace RiaDefines diff --git a/ApplicationLibCode/Application/RiaPreferencesSystem.cpp b/ApplicationLibCode/Application/RiaPreferencesSystem.cpp index d8ec5b48da..d93a62324e 100644 --- a/ApplicationLibCode/Application/RiaPreferencesSystem.cpp +++ b/ApplicationLibCode/Application/RiaPreferencesSystem.cpp @@ -85,6 +85,7 @@ RiaPreferencesSystem::RiaPreferencesSystem() caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showPdfExportDialog ); CAF_PDM_InitField( &m_gtestFilter, "gtestFilter", QString(), "Unit Test Filter (gtest)" ); + CAF_PDM_InitField( &m_exportScalingFactor, "exportScalingFactor", -1.0, "Export Scaling Factor (<0 disable)" ); CAF_PDM_InitField( &m_eclipseReaderMode, "eclipseReaderMode", @@ -206,6 +207,14 @@ bool RiaPreferencesSystem::showPdfExportDialog() const return m_showPdfExportDialog(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RiaPreferencesSystem::exportPdfScalingFactor() const +{ + return m_exportScalingFactor(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -238,7 +247,9 @@ void RiaPreferencesSystem::defineUiOrdering( QString uiConfigName, caf::PdmUiOrd uiOrdering.add( &m_includeFractureDebugInfoFile ); uiOrdering.add( &m_holoLensExportFolder ); uiOrdering.add( &m_showProgressBar ); + uiOrdering.add( &m_showPdfExportDialog ); + uiOrdering.add( &m_exportScalingFactor ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/RiaPreferencesSystem.h b/ApplicationLibCode/Application/RiaPreferencesSystem.h index a0cb1d74bc..4a7bb19160 100644 --- a/ApplicationLibCode/Application/RiaPreferencesSystem.h +++ b/ApplicationLibCode/Application/RiaPreferencesSystem.h @@ -54,6 +54,7 @@ public: QString gtestFilter() const; bool showProgressBar() const; bool showPdfExportDialog() const; + double exportPdfScalingFactor() const; EclipseTextFileReaderMode eclipseTextFileReaderMode() const; @@ -78,7 +79,9 @@ private: caf::PdmField m_includeFractureDebugInfoFile; caf::PdmField m_holoLensExportFolder; - caf::PdmField m_showPdfExportDialog; + caf::PdmField m_showPdfExportDialog; + caf::PdmField m_exportScalingFactor; + caf::PdmField m_showProgressBar; caf::PdmField m_gtestFilter; diff --git a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToPdfFeature.cpp b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToPdfFeature.cpp index 1a369dcbe4..a7f954a735 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToPdfFeature.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToPdfFeature.cpp @@ -72,12 +72,12 @@ void RicSnapshotViewToPdfFeature::onActionTriggered( bool isChecked ) } else { - fileName = defaultFileName + ".pdf"; + fileName = defaultFileName + "." + fileExtension; } if ( !fileName.isEmpty() ) { - if ( plotWindow && fileName.endsWith( "PDF", Qt::CaseInsensitive ) ) + if ( plotWindow && fileName.endsWith( fileExtension, Qt::CaseInsensitive ) ) { RicSnapshotViewToFileFeature::savePlotPdfReportAs( fileName, plotWindow ); diff --git a/ApplicationLibCode/Commands/ViewLink/RicLinkVisibleViewsFeatureUi.cpp b/ApplicationLibCode/Commands/ViewLink/RicLinkVisibleViewsFeatureUi.cpp index 21acad64d6..8c70496330 100644 --- a/ApplicationLibCode/Commands/ViewLink/RicLinkVisibleViewsFeatureUi.cpp +++ b/ApplicationLibCode/Commands/ViewLink/RicLinkVisibleViewsFeatureUi.cpp @@ -34,7 +34,7 @@ CAF_PDM_SOURCE_INIT( RicLinkVisibleViewsFeatureUi, "RicLinkVisibleViewsFeatureUi //-------------------------------------------------------------------------------------------------- RicLinkVisibleViewsFeatureUi::RicLinkVisibleViewsFeatureUi( void ) { - CAF_PDM_InitObject( "Link Visible Views Feature UI", ":/LinkView16x16.png" ); + CAF_PDM_InitObject( "Link Visible Views Feature UI", ":/LinkView.svg" ); CAF_PDM_InitFieldNoDefault( &m_masterView, "MasterView", "Primary View" ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp index 243df83250..ca4b81f23e 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp @@ -96,6 +96,8 @@ RimPlotAxisProperties::RimPlotAxisProperties() CAF_PDM_InitFieldNoDefault( &m_annotations, "Annotations", "" ); m_annotations.uiCapability()->setUiTreeHidden( true ); + CAF_PDM_InitFieldNoDefault( &m_majorTickmarkCount, "MajorTickmarkCount", "Major Tickmark Count" ); + updateOptionSensitivity(); } @@ -231,6 +233,7 @@ void RimPlotAxisProperties::defineUiOrdering( QString uiConfigName, caf::PdmUiOr scaleGroup.add( &m_visibleRangeMax ); } scaleGroup.add( &m_valuesFontSize ); + scaleGroup.add( &m_majorTickmarkCount ); scaleGroup.add( &m_plotAxis ); m_plotAxis.uiCapability()->setUiReadOnly( m_isAlwaysRequired ); @@ -437,6 +440,22 @@ void RimPlotAxisProperties::setVisibleRangeMax( double value ) m_visibleRangeMax = value; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPlotAxisPropertiesInterface::LegendTickmarkCount RimPlotAxisProperties::majorTickmarkCount() const +{ + return m_majorTickmarkCount(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPlotAxisProperties::setMajorTickmarkCount( LegendTickmarkCount count ) +{ + m_majorTickmarkCount = count; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h index 886d4019e7..a96cdfb090 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h @@ -103,6 +103,9 @@ public: void setVisibleRangeMin( double value ) override; void setVisibleRangeMax( double value ) override; + LegendTickmarkCount majorTickmarkCount() const override; + void setMajorTickmarkCount( LegendTickmarkCount count ) override; + protected: void initAfterRead() override; caf::PdmFieldHandle* userDescriptionField() override; @@ -134,6 +137,7 @@ private: caf::PdmField m_name; caf::PdmField> m_plotAxis; caf::PdmField m_plotAxisIndex; + caf::PdmField m_majorTickmarkCount; caf::PdmField m_isLogarithmicScaleEnabled; diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.cpp index 9189c4a337..20ef8d8628 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.cpp @@ -15,9 +15,13 @@ // for more details. // ///////////////////////////////////////////////////////////////////////////////// + #include "RimPlotAxisPropertiesInterface.h" +#include "RimSummaryMultiPlot.h" + #include "cafAppEnum.h" +#include "cafPdmUiTreeAttributes.h" CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimPlotAxisPropertiesInterface, "PlotAxisPropertiesInterface", @@ -68,3 +72,53 @@ bool RimPlotAxisPropertiesInterface::isLogarithmicScaleEnabled() const { return false; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimPlotAxisPropertiesInterface::tickmarkCountFromEnum( LegendTickmarkCount count ) +{ + int maxTickmarkCount = 8; + + switch ( count ) + { + case LegendTickmarkCount::TICKMARK_VERY_FEW: + maxTickmarkCount = 2; + break; + case LegendTickmarkCount::TICKMARK_FEW: + maxTickmarkCount = 4; + break; + case LegendTickmarkCount::TICKMARK_DEFAULT: + maxTickmarkCount = 8; // Taken from QwtPlot::initAxesData() + break; + case LegendTickmarkCount::TICKMARK_MANY: + maxTickmarkCount = 10; + break; + default: + break; + } + + return maxTickmarkCount; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPlotAxisPropertiesInterface::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) +{ + RimSummaryMultiPlot* summaryMultiPlot = nullptr; + firstAncestorOfType( summaryMultiPlot ); + + if ( summaryMultiPlot && summaryMultiPlot->isSubPlotAxesLinked() ) + { + auto* treeItemAttribute = dynamic_cast( attribute ); + if ( treeItemAttribute ) + { + treeItemAttribute->tags.clear(); + auto tag = caf::PdmUiTreeViewItemAttribute::Tag::create(); + tag->icon = caf::IconProvider( ":/chain.png" ); + + treeItemAttribute->tags.push_back( std::move( tag ) ); + } + } +} diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h index b88fb58a4b..693efece25 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h @@ -74,8 +74,16 @@ public: virtual bool isLogarithmicScaleEnabled() const; + virtual LegendTickmarkCount majorTickmarkCount() const = 0; + virtual void setMajorTickmarkCount( LegendTickmarkCount count ) = 0; + + static int tickmarkCountFromEnum( LegendTickmarkCount count ); + public: virtual AxisTitlePositionType titlePosition() const = 0; virtual int titleFontSize() const = 0; virtual int valuesFontSize() const = 0; + +private: + void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; }; diff --git a/ApplicationLibCode/ProjectDataModel/RimProject.cpp b/ApplicationLibCode/ProjectDataModel/RimProject.cpp index 891b4e877e..686580de7c 100644 --- a/ApplicationLibCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimProject.cpp @@ -157,10 +157,7 @@ RimProject::RimProject( void ) CAF_PDM_InitFieldNoDefault( &mainPlotCollection, "MainPlotCollection", "Plots" ); mainPlotCollection.uiCapability()->setUiTreeHidden( true ); - CAF_PDM_InitFieldNoDefault( &viewLinkerCollection, - "LinkedViews", - "Linked Views (field in RimProject", - ":/LinkView16x16.png" ); + CAF_PDM_InitFieldNoDefault( &viewLinkerCollection, "LinkedViews", "Linked Views", ":/LinkView.svg" ); viewLinkerCollection.uiCapability()->setUiTreeHidden( true ); viewLinkerCollection = new RimViewLinkerCollection; diff --git a/ApplicationLibCode/ProjectDataModel/RimViewLinkerCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimViewLinkerCollection.cpp index 138e427be3..fd9f4d2021 100644 --- a/ApplicationLibCode/ProjectDataModel/RimViewLinkerCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimViewLinkerCollection.cpp @@ -31,7 +31,7 @@ CAF_PDM_SOURCE_INIT( RimViewLinkerCollection, "RimViewLinkerCollection" ); //-------------------------------------------------------------------------------------------------- RimViewLinkerCollection::RimViewLinkerCollection( void ) { - CAF_PDM_InitObject( "Linked Views", ":/LinkView16x16.png" ); + CAF_PDM_InitObject( "Linked Views", ":/LinkView.svg" ); CAF_PDM_InitField( &isActive, "Active", true, "Active" ); isActive.uiCapability()->setUiHidden( true ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp index 211db93431..4c0251bf51 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp @@ -307,7 +307,6 @@ void RimSummaryMultiPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde auto layoutGroup = uiOrdering.addNewGroup( "Layout" ); layoutGroup->add( &m_columnCount ); layoutGroup->add( &m_rowsPerPage ); - layoutGroup->add( &m_majorTickmarkCount ); auto axesGroup = uiOrdering.addNewGroup( "Axes" ); axesGroup->add( &m_axisRangeAggregation ); @@ -787,6 +786,14 @@ void RimSummaryMultiPlot::makeSureIsVisible( RimSummaryPlot* summaryPlot ) if ( summaryPlot->plotWidget() && !m_viewer.isNull() ) m_viewer->scrollToPlot( summaryPlot->plotWidget() ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimSummaryMultiPlot::isSubPlotAxesLinked() const +{ + return m_linkSubPlotAxes(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.h index 604b9e047f..fc7ca8fade 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.h @@ -90,6 +90,8 @@ public: void makeSureIsVisible( RimSummaryPlot* plot ); + bool isSubPlotAxesLinked() const; + void zoomAll() override; protected: diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 4db4599a0d..553dc6f62f 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -849,6 +849,11 @@ void RimSummaryPlot::updateAxis( RiaDefines::PlotAxis plotAxis ) } plotWidget()->enableAxisNumberLabels( riuPlotAxis, axisProperties->showNumbers() ); + + RimSummaryTimeAxisProperties::LegendTickmarkCount tickmarkCountEnum = axisProperties->majorTickmarkCount(); + int maxTickmarkCount = RimPlotAxisPropertiesInterface::tickmarkCountFromEnum( tickmarkCountEnum ); + + plotWidget()->setAutoTickIntervalCounts( riuPlotAxis, maxTickmarkCount, maxTickmarkCount ); } } } @@ -1110,26 +1115,7 @@ void RimSummaryPlot::updateTimeAxis( RimSummaryTimeAxisProperties* timeAxisPrope { RimSummaryTimeAxisProperties::LegendTickmarkCount tickmarkCountEnum = timeAxisProperties->majorTickmarkCount(); - - int maxTickmarkCount = 8; - - switch ( tickmarkCountEnum ) - { - case RimSummaryTimeAxisProperties::LegendTickmarkCount::TICKMARK_VERY_FEW: - maxTickmarkCount = 2; - break; - case RimSummaryTimeAxisProperties::LegendTickmarkCount::TICKMARK_FEW: - maxTickmarkCount = 4; - break; - case RimSummaryTimeAxisProperties::LegendTickmarkCount::TICKMARK_DEFAULT: - maxTickmarkCount = 8; // Taken from QwtPlot::initAxesData() - break; - case RimSummaryTimeAxisProperties::LegendTickmarkCount::TICKMARK_MANY: - maxTickmarkCount = 10; - break; - default: - break; - } + int maxTickmarkCount = RimPlotAxisPropertiesInterface::tickmarkCountFromEnum( tickmarkCountEnum ); plotWidget()->setAxisMaxMajor( RiuPlotAxis::defaultBottom(), maxTickmarkCount ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp index 78ad7e23cd..8c6821907f 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp @@ -573,7 +573,10 @@ void RimSummaryTimeAxisProperties::defineUiOrdering( QString uiConfigName, caf:: timeGroup->add( &m_visibleTimeSinceStartRangeMax ); timeGroup->add( &m_visibleTimeSinceStartRangeMin ); } + timeGroup->add( &m_valuesFontSize ); + timeGroup->add( &m_majorTickmarkCount ); + if ( m_timeMode() == DATE ) { caf::PdmUiGroup* advancedGroup = timeGroup->addNewGroup( "Date/Time Label Format" ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h index 699ef2f1c5..a7849fa5ef 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h @@ -104,8 +104,8 @@ public: void setVisibleDateTimeMin( const QDateTime& dateTime ); void setVisibleDateTimeMax( const QDateTime& dateTime ); - LegendTickmarkCount majorTickmarkCount() const; - void setMajorTickmarkCount( LegendTickmarkCount count ); + LegendTickmarkCount majorTickmarkCount() const override; + void setMajorTickmarkCount( LegendTickmarkCount count ) override; const QString& name() const override; diff --git a/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp b/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp index f8874f35a5..056a38a33d 100644 --- a/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp +++ b/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp @@ -18,6 +18,7 @@ #include "RiuMultiPlotBook.h" #include "RiaGuiApplication.h" +#include "RiaPlotDefines.h" #include "RiaPlotWindowRedrawScheduler.h" #include "RiaPreferences.h" @@ -342,8 +343,7 @@ void RiuMultiPlotBook::scheduleReplotOfAllPlots() //-------------------------------------------------------------------------------------------------- void RiuMultiPlotBook::renderTo( QPaintDevice* paintDevice ) { - int resolution = paintDevice->logicalDpiX(); - double scaling = resolution / static_cast( RiaGuiApplication::applicationResolution() ); + auto scaling = RiaDefines::scalingFactor( paintDevice ); QPainter painter( paintDevice ); diff --git a/ApplicationLibCode/UserInterface/RiuMultiPlotPage.cpp b/ApplicationLibCode/UserInterface/RiuMultiPlotPage.cpp index f131a28f46..ca6c3d8e61 100644 --- a/ApplicationLibCode/UserInterface/RiuMultiPlotPage.cpp +++ b/ApplicationLibCode/UserInterface/RiuMultiPlotPage.cpp @@ -26,6 +26,7 @@ #include "WellLogCommands/RicWellLogPlotTrackFeatureImpl.h" #include "RiaGuiApplication.h" +#include "RiaPlotDefines.h" #include "RimContextCommandBuilder.h" #include "RimMultiPlot.h" @@ -359,8 +360,7 @@ void RiuMultiPlotPage::updateSubTitles() //-------------------------------------------------------------------------------------------------- void RiuMultiPlotPage::renderTo( QPaintDevice* paintDevice ) { - int resolution = paintDevice->logicalDpiX(); - double scaling = resolution / static_cast( RiaGuiApplication::applicationResolution() ); + auto scaling = RiaDefines::scalingFactor( paintDevice ); QPainter painter( paintDevice ); renderTo( &painter, scaling ); diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp index 2853f282f4..2853fc747b 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp @@ -24,6 +24,7 @@ #include "RiaGuiApplication.h" #include "RiaPlotDefines.h" #include "RiaPlotWindowRedrawScheduler.h" + #include "RimPlot.h" #include "RiuDraggableOverlayFrame.h" @@ -757,8 +758,8 @@ void RiuQwtPlotWidget::renderTo( QPainter* painter, const QRect& targetRect, dou //-------------------------------------------------------------------------------------------------- void RiuQwtPlotWidget::renderTo( QPaintDevice* paintDevice, const QRect& targetRect ) { - int resolution = paintDevice->logicalDpiX(); - double scaling = resolution / static_cast( RiaGuiApplication::applicationResolution() ); + auto scaling = RiaDefines::scalingFactor( paintDevice ); + QPainter painter( paintDevice ); renderTo( &painter, targetRect, scaling ); }