From 55625a25ee565f82458e17f6165b17d77737e730 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Fri, 2 Feb 2024 14:03:16 +0100 Subject: [PATCH] IMPROVED/FIXED outside space requirements for color bars. Text was sometime too close to the plot border. --- doc/dox/whatsnew.dox | 1 + lib/jkqtplotter/jkqtpimagetools.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox index def0abe0e1..85495b3a03 100644 --- a/doc/dox/whatsnew.dox +++ b/doc/dox/whatsnew.dox @@ -60,6 +60,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
  • FIXED/IMPROVED issue #100: Add option to disable resize delay feature by setting the delay to zero (thanks to user:fpalazzolo for reporting)
  • FIXED/NEW: placement of plot-title (was not centerd in its box, but glued to the bottom) by adding a plotstyle parameter JKQTBasePlotterStyle::plotLabelOffset
  • FIXED/REWORKED issue #111: Can't write to PDF files with JKQTPlotter::saveImage() when passing a filename ending in ".pdf" (thanks to user:fpalazzolo for reporting):
    While fixing this issue, the functions JKQTBasePlotter::saveImage() etc. gained a bool return value to indicate whether sacing was successful.
  • +
  • IMPROVED/FIXED outside space requirements for color bars. Text was sometime too close to the plot border.
  • REWORKED JKQTBasePlotter::saveData() with a more consistent interface and a bool return value to indicate success or failure + improved documentation, added methods to JKQTPSaveDataAdapter that allow to specify file extensions and an ID for the plugin.
  • REORGANIZED: separated line-graphs from jkqtpscatter.h/.cpp into jkqtplines.h/.cpp
  • IMPROVED: QT6-compatibility by removing deprecated warnings
  • diff --git a/lib/jkqtplotter/jkqtpimagetools.cpp b/lib/jkqtplotter/jkqtpimagetools.cpp index cacc329b63..8d8abda6a0 100644 --- a/lib/jkqtplotter/jkqtpimagetools.cpp +++ b/lib/jkqtplotter/jkqtpimagetools.cpp @@ -558,10 +558,11 @@ void JKQTPColorPaletteWithModifierStyleAndToolsMixin::cbGetOutsideSize(JKQTPEnha double internalDataMax=0; double internalModifierMin=0; double internalModifierMax=0; + const double axisSepPT=cbParent->getCurrentPlotterStyle().secondaryAxisSeparation; cbGetDataMinMax(internalDataMin, internalDataMax); cbGetModifierDataMinMax(internalDataMin, internalDataMax); if (colorBarRightVisible) { - rightSpace+=cbParent->pt2px(painter, colorBarWidth+colorBarOffset); + rightSpace+=cbParent->pt2px(painter, colorBarWidth+colorBarOffset+axisSepPT); colorBarRightAxis->setRange(internalDataMin, internalDataMax); colorBarRightAxis->setAxisWidth(colorBarRelativeHeight*cbParent->getPlotHeight()); modifierColorBarRightAxis->setRange(internalModifierMin, internalModifierMax); @@ -583,7 +584,7 @@ void JKQTPColorPaletteWithModifierStyleAndToolsMixin::cbGetOutsideSize(JKQTPEnha const auto s1=colorBarTopAxis->getSize2(painter); const auto s2=colorBarTopAxis->getSize1(painter); const QSizeF names=cbParent->getTextSizeSize(imageNameFontName, imageNameFontSize*cbParent->getFontSizeMultiplier(), imageName, painter); - topSpace+=cbParent->pt2px(painter, colorBarWidth+colorBarOffset)+qMax(static_cast(s1.requiredSize+s2.requiredSize), static_cast(names.height())); + topSpace+= cbParent->pt2px(painter, colorBarWidth+colorBarOffset+axisSepPT)+qMax(static_cast(s1.requiredSize+s2.requiredSize), static_cast(names.height())); if (modifierMode!=JKQTPMathImageModifierMode::ModifyNone) { topSpace=topSpace+static_cast(2.0*cbParent->pt2px(painter, colorBarModifiedWidth-colorBarWidth)); }