renamed and moved XPDF zoom constants to make them more readable and open to further development

preferencesAboutTextFull
Clément Fauconnier 4 years ago
parent d5988f979c
commit 505ca347af
  1. 15
      src/pdf/XPDFRenderer.cpp
  2. 9
      src/pdf/XPDFRenderer.h

@ -42,13 +42,6 @@
QAtomicInt XPDFRenderer::sInstancesCount = 0; QAtomicInt XPDFRenderer::sInstancesCount = 0;
namespace constants{
const double mode1_zoomFactor = 3.0;
const double mode2_zoomFactorStage1 = 2.5;
const double mode2_zoomFactorStage2 = 5.0;
const double mode2_zoomFactorStage3 = 10.0;
}
XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile) : XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile) :
mpSplashBitmapHistorical(nullptr), mSplashHistorical(nullptr), mDocument(nullptr) mpSplashBitmapHistorical(nullptr), mSplashHistorical(nullptr), mDocument(nullptr)
{ {
@ -57,12 +50,12 @@ XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile) :
break; break;
case 1: // Render a single image, degradated quality when zoomed big. case 1: // Render a single image, degradated quality when zoomed big.
default: default:
m_pdfZoomCache.push_back(constants::mode1_zoomFactor); m_pdfZoomCache.push_back(XPDFRendererZoomFactor::mode1_zoomFactor);
break; break;
case 2: // Render three images, optimal quality all the time. case 2: // Render three images, optimal quality all the time.
m_pdfZoomCache.push_back(constants::mode2_zoomFactorStage1); m_pdfZoomCache.push_back(XPDFRendererZoomFactor::mode2_zoomFactorStage1);
m_pdfZoomCache.push_back(constants::mode2_zoomFactorStage2); m_pdfZoomCache.push_back(XPDFRendererZoomFactor::mode2_zoomFactorStage2);
m_pdfZoomCache.push_back(constants::mode2_zoomFactorStage3); m_pdfZoomCache.push_back(XPDFRendererZoomFactor::mode2_zoomFactorStage3);
break; break;
} }

@ -51,6 +51,15 @@
class PDFDoc; class PDFDoc;
namespace XPDFRendererZoomFactor
{
const double mode1_zoomFactor = 3.0;
const double mode2_zoomFactorStage1 = 2.5;
const double mode2_zoomFactorStage2 = 5.0;
const double mode2_zoomFactorStage3 = 10.0;
}
class XPDFRenderer : public PDFRenderer class XPDFRenderer : public PDFRenderer
{ {
Q_OBJECT Q_OBJECT

Loading…
Cancel
Save