Skip to content

Commit 6b41e91

Browse files
committed
Code review fixes
1 parent d825528 commit 6b41e91

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

src/framework/draw/drawmodule.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ void DrawModule::registerExports()
4949

5050
ioc()->registerExport<draw::IImageProvider>(moduleName(), new QImageProvider());
5151

52-
auto mainFProvider = std::make_shared<FontProvider>(iocContext());
5352
auto qtFProvider = std::make_shared<QFontProvider>();
54-
auto fdispatcher = std::make_shared<FontProviderDispatcher>(mainFProvider, qtFProvider);
5553

5654
m_fontsEngine = std::make_shared<FontsEngine>(iocContext());
5755
ioc()->registerExport<draw::IFontProvider>(moduleName(), qtFProvider);

src/framework/draw/internal/qfontprovider.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
#include <QFontMetricsF>
2828
#include <QRawFont>
2929

30-
#include "engraving/dom/mscore.h"
31-
3230
using namespace muse;
3331
using namespace muse::draw;
3432

@@ -41,11 +39,12 @@ class FontPaintDevice : public QPaintDevice
4139
}
4240

4341
protected:
42+
static constexpr double MU_ENGRAVING_DPI = 2540; // Same as mu::engraving::DPI. TODO: pass as parameter
4443
int metric(PaintDeviceMetric m) const override
4544
{
4645
switch (m) {
4746
case QPaintDevice::PdmDpiY:
48-
return mu::engraving::DPI;
47+
return MU_ENGRAVING_DPI;
4948
default:
5049
return 1;
5150
}

src/framework/draw/painter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include "types/brush.h"
2525
#include "types/painterpath.h"
2626

27-
#include "engraving/dom/mscore.h"
28-
2927
#ifndef NO_QT_SUPPORT
3028
#include "internal/qpainterprovider.h"
3129
#endif
@@ -429,8 +427,9 @@ void Painter::drawRoundedRect(const RectF& rect, double xRadius, double yRadius)
429427

430428
void Painter::applyFontSizeScaling()
431429
{
430+
static constexpr double MU_ENGRAVING_DPI = 2540; // Same as mu::engraving::DPI. TODO: pass as parameter.
432431
Font f = font();
433-
double scaledPointSize = f.pointSizeF() * mu::engraving::DPI / deviceLogicalDpi();
432+
double scaledPointSize = f.pointSizeF() * MU_ENGRAVING_DPI / deviceLogicalDpi();
434433
f.setPointSizeF(scaledPointSize);
435434
setFont(f);
436435
}

src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass1.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,8 +1898,6 @@ static double scaleText(const String& str, const Sid fontFaceSid, const double f
18981898
const FontMetrics fm(font);
18991899

19001900
const double pagePrintableWidth = style.styleV(Sid::pagePrintableWidth).value<double>() * DPI;
1901-
const double pageWidth = style.styleV(Sid::pageWidth).value<double>() * DPI;
1902-
const double pageHeight = style.styleV(Sid::pageHeight).value<double>() * DPI;
19031901

19041902
double longestLine = 0.0;
19051903
for (const String& line : str.split(u"\n")) {

0 commit comments

Comments
 (0)