summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-02 11:03:08 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-04 23:00:15 +0100
commit033a342a630dbb6329962156727e621866b77b48 (patch)
tree65a5a60d564769fc0918bfa7615dde5799f6c3be
parentd470c26d1635e7408e44fc76e584e244b87809ef (diff)
lok: use twips in Math
Change-Id: I11acd281da64b0023d74b3bc02e0f54864b94da9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142275 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142291 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r--starmath/inc/utility.hxx13
-rw-r--r--starmath/source/ElementsDockingWindow.cxx2
-rw-r--r--starmath/source/cfgitem.cxx4
-rw-r--r--starmath/source/dialog.cxx4
-rw-r--r--starmath/source/document.cxx26
-rw-r--r--starmath/source/format.cxx2
-rw-r--r--starmath/source/mathml/mathmlexport.cxx2
-rw-r--r--starmath/source/node.cxx6
-rw-r--r--starmath/source/tmpdevice.cxx6
-rw-r--r--starmath/source/unomodel.cxx6
-rw-r--r--starmath/source/utility.cxx2
-rw-r--r--starmath/source/view.cxx49
12 files changed, 74 insertions, 48 deletions
diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx
index c0b473264532..a05578a53647 100644
--- a/starmath/inc/utility.hxx
+++ b/starmath/inc/utility.hxx
@@ -21,10 +21,13 @@
#include <sal/config.h>
+#include <comphelper/lok.hxx>
+#include <o3tl/unit_conversion.hxx>
#include <sal/log.hxx>
#include <vcl/font.hxx>
#include <vcl/weld.hxx>
#include <tools/fract.hxx>
+#include <tools/mapunit.hxx>
#include <deque>
@@ -113,4 +116,14 @@ public:
virtual void Insert(const vcl::Font &rFont) override;
};
+// Math uses 100ths of MM by default, but lok needs twips everywhere
+inline MapUnit SmMapUnit()
+{
+ return comphelper::LibreOfficeKit::isActive() ? MapUnit::MapTwip : MapUnit::Map100thMM;
+}
+inline o3tl::Length SmO3tlLengthUnit()
+{
+ return comphelper::LibreOfficeKit::isActive() ? o3tl::Length::twip : o3tl::Length::mm100;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index daf53e3ac9e3..8a34fdb551d7 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -506,7 +506,7 @@ void SmElementsControl::addElement(const OUString& aElementVisual, const OUStrin
std::unique_ptr<SmNode> pNode = maParser->ParseExpression(aElementVisual);
VclPtr<VirtualDevice> pDevice(mpIconView->create_virtual_device());
pDevice->SetTextRenderModeForResolutionIndependentLayout(true);
- pDevice->SetMapMode(MapMode(MapUnit::Map100thMM));
+ pDevice->SetMapMode(MapMode(SmMapUnit()));
pDevice->SetDrawMode(DrawModeFlags::Default);
pDevice->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default);
pDevice->SetDigitLanguage(LANGUAGE_ENGLISH);
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 395bf932d822..7c5323b33c57 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -888,7 +888,7 @@ void SmMathConfig::LoadFormat()
++pVal;
// StandardFormat/BaseSize
if (pVal->hasValue() && (*pVal >>= nTmp16))
- pFormat->SetBaseSize(Size(0, o3tl::convert(nTmp16, o3tl::Length::pt, o3tl::Length::mm100)));
+ pFormat->SetBaseSize(Size(0, o3tl::convert(nTmp16, o3tl::Length::pt, SmO3tlLengthUnit())));
++pVal;
sal_uInt16 i;
@@ -960,7 +960,7 @@ void SmMathConfig::SaveFormat()
*pValue++ <<= static_cast<sal_Int16>(pFormat->GetHorAlign());
// StandardFormat/BaseSize
*pValue++ <<= static_cast<sal_Int16>(
- o3tl::convert(pFormat->GetBaseSize().Height(), o3tl::Length::mm100, o3tl::Length::pt));
+ o3tl::convert(pFormat->GetBaseSize().Height(), SmO3tlLengthUnit(), o3tl::Length::pt));
sal_uInt16 i;
for (i = SIZ_BEGIN; i <= SIZ_END; ++i)
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 1180853e9bcd..fcfa51a7a4b6 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -393,7 +393,7 @@ void SmFontSizeDialog::ReadFrom(const SmFormat &rFormat)
{
//! watch out: round properly!
m_xBaseSize->set_value(
- o3tl::convert(rFormat.GetBaseSize().Height(), o3tl::Length::mm100, o3tl::Length::pt),
+ o3tl::convert(rFormat.GetBaseSize().Height(), SmO3tlLengthUnit(), o3tl::Length::pt),
FieldUnit::NONE);
m_xTextSize->set_value( rFormat.GetRelSize(SIZ_TEXT), FieldUnit::NONE );
@@ -405,7 +405,7 @@ void SmFontSizeDialog::ReadFrom(const SmFormat &rFormat)
void SmFontSizeDialog::WriteTo(SmFormat &rFormat) const
{
- rFormat.SetBaseSize( Size(0, o3tl::convert(m_xBaseSize->get_value(FieldUnit::NONE), o3tl::Length::pt, o3tl::Length::mm100)) );
+ rFormat.SetBaseSize( Size(0, o3tl::convert(m_xBaseSize->get_value(FieldUnit::NONE), o3tl::Length::pt, SmO3tlLengthUnit())) );
rFormat.SetRelSize(SIZ_TEXT, sal::static_int_cast<sal_uInt16>(m_xTextSize->get_value(FieldUnit::NONE)));
rFormat.SetRelSize(SIZ_INDEX, sal::static_int_cast<sal_uInt16>(m_xIndexSize->get_value(FieldUnit::NONE)));
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 67c97d735198..5c49f1e2978e 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -257,10 +257,10 @@ void SmDocShell::ArrangeFormula()
else
{
pOutDev = &SM_MOD()->GetDefaultVirtualDev();
- pOutDev->SetMapMode( MapMode(MapUnit::Map100thMM) );
+ pOutDev->SetMapMode( MapMode(SmMapUnit()) );
}
}
- OSL_ENSURE(pOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM,
+ OSL_ENSURE(pOutDev->GetMapMode().GetMapUnit() == SmMapUnit(),
"Sm : wrong MapMode");
const SmFormat &rFormat = GetFormat();
@@ -421,13 +421,13 @@ SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell )
//!this class.
const MapUnit eOld = pPrinter->GetMapMode().GetMapUnit();
- if ( MapUnit::Map100thMM != eOld )
+ if ( SmMapUnit() != eOld )
{
MapMode aMap( pPrinter->GetMapMode() );
- aMap.SetMapUnit( MapUnit::Map100thMM );
+ aMap.SetMapUnit( SmMapUnit() );
Point aTmp( aMap.GetOrigin() );
- aTmp.setX( OutputDevice::LogicToLogic( aTmp.X(), eOld, MapUnit::Map100thMM ) );
- aTmp.setY( OutputDevice::LogicToLogic( aTmp.Y(), eOld, MapUnit::Map100thMM ) );
+ aTmp.setX( OutputDevice::LogicToLogic( aTmp.X(), eOld, SmMapUnit() ) );
+ aTmp.setY( OutputDevice::LogicToLogic( aTmp.Y(), eOld, SmMapUnit() ) );
aMap.SetOrigin( aTmp );
pPrinter->SetMapMode( aMap );
}
@@ -449,13 +449,13 @@ SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell )
//!this class.
const MapUnit eOld = pRefDev->GetMapMode().GetMapUnit();
- if ( MapUnit::Map100thMM != eOld )
+ if ( SmMapUnit() != eOld )
{
MapMode aMap( pRefDev->GetMapMode() );
- aMap.SetMapUnit( MapUnit::Map100thMM );
+ aMap.SetMapUnit( SmMapUnit() );
Point aTmp( aMap.GetOrigin() );
- aTmp.setX( OutputDevice::LogicToLogic( aTmp.X(), eOld, MapUnit::Map100thMM ) );
- aTmp.setY( OutputDevice::LogicToLogic( aTmp.Y(), eOld, MapUnit::Map100thMM ) );
+ aTmp.setX( OutputDevice::LogicToLogic( aTmp.X(), eOld, SmMapUnit() ) );
+ aTmp.setY( OutputDevice::LogicToLogic( aTmp.Y(), eOld, SmMapUnit() ) );
aMap.SetOrigin( aTmp );
pRefDev->SetMapMode( aMap );
}
@@ -490,7 +490,7 @@ Printer* SmDocShell::GetPrt()
SmModule *pp = SM_MOD();
pp->GetConfig()->ConfigToItemSet(*pOptions);
mpPrinter = VclPtr<SfxPrinter>::Create(std::move(pOptions));
- mpPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
+ mpPrinter->SetMapMode(MapMode(SmMapUnit()));
}
return mpPrinter;
}
@@ -511,7 +511,7 @@ void SmDocShell::SetPrinter( SfxPrinter *pNew )
{
mpPrinter.disposeAndClear();
mpPrinter = pNew; //Transfer ownership
- mpPrinter->SetMapMode( MapMode(MapUnit::Map100thMM) );
+ mpPrinter->SetMapMode( MapMode(SmMapUnit()) );
SetFormulaArranged(false);
Repaint();
}
@@ -566,6 +566,8 @@ SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags )
SetBaseModel(new SmModel(this));
SetSmSyntaxVersion(mnSmSyntaxVersion);
+
+ SetMapUnit(SmMapUnit());
}
SmDocShell::~SmDocShell()
diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx
index d11aa65f842f..d517c58f3e1b 100644
--- a/starmath/source/format.cxx
+++ b/starmath/source/format.cxx
@@ -21,7 +21,7 @@
SmFormat::SmFormat()
-: aBaseSize(0, o3tl::convert(12, o3tl::Length::pt, o3tl::Length::mm100))
+: aBaseSize(0, o3tl::convert(12, o3tl::Length::pt, SmO3tlLengthUnit()))
{
eHorAlign = SmHorAlign::Center;
nGreekCharStyle = 0;
diff --git a/starmath/source/mathml/mathmlexport.cxx b/starmath/source/mathml/mathmlexport.cxx
index ca9453d8d0ab..64c203ddec73 100644
--- a/starmath/source/mathml/mathmlexport.cxx
+++ b/starmath/source/mathml/mathmlexport.cxx
@@ -1193,7 +1193,7 @@ void SmXMLExport::ExportFont(const SmNode* pNode, int nLevel)
//Must fix StarMath to retain the original pt values
double mytest
= o3tl::convert<double>(pFontNode->GetFont().GetFontSize().Height(),
- o3tl::Length::mm100, o3tl::Length::pt);
+ SmO3tlLengthUnit(), o3tl::Length::pt);
if (pFontNode->GetSizeType() == FontSizeType::MINUS)
mytest -= static_cast<double>(aFrac);
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index d7615befe26d..7d076d4ebd4c 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -23,6 +23,7 @@
#include "tmpdevice.hxx"
#include <visitors.hxx>
+#include <tools/UnitConversion.hxx>
#include <vcl/metric.hxx>
#include <osl/diagnose.h>
@@ -134,8 +135,7 @@ void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType)
if (!(Flags() & FontChangeMask::Size))
{
- constexpr auto md = o3tl::getConversionMulDiv(o3tl::Length::pt, o3tl::Length::mm100);
- Fraction aVal (Fraction(md.first, md.second) * rSize);
+ Fraction aVal(conversionFract(o3tl::Length::pt, SmO3tlLengthUnit()) * rSize);
tools::Long nHeight = static_cast<tools::Long>(aVal);
aFntSize = GetFont().GetFontSize();
@@ -167,7 +167,7 @@ void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType)
}
// check the requested size against maximum value
- constexpr int nMaxVal = o3tl::convert(128, o3tl::Length::pt, o3tl::Length::mm100);
+ const int nMaxVal = o3tl::convert(128, o3tl::Length::pt, SmO3tlLengthUnit());
if (aFntSize.Height() > nMaxVal)
aFntSize.setHeight( nMaxVal );
diff --git a/starmath/source/tmpdevice.cxx b/starmath/source/tmpdevice.cxx
index 5eee10d9670f..1e30fbc7cd11 100644
--- a/starmath/source/tmpdevice.cxx
+++ b/starmath/source/tmpdevice.cxx
@@ -18,6 +18,8 @@
*/
#include <smmod.hxx>
+#include <utility.hxx>
+
#include "tmpdevice.hxx"
#include <svtools/colorcfg.hxx>
@@ -36,10 +38,10 @@ SmTmpDevice::SmTmpDevice(OutputDevice &rTheDev, bool bUseMap100th_mm) :
{
rOutDev.Push(vcl::PushFlags::FONT | vcl::PushFlags::MAPMODE |
vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR | vcl::PushFlags::TEXTCOLOR);
- if (bUseMap100th_mm && MapUnit::Map100thMM != rOutDev.GetMapMode().GetMapUnit())
+ if (bUseMap100th_mm && SmMapUnit() != rOutDev.GetMapMode().GetMapUnit())
{
SAL_WARN("starmath", "incorrect MapMode?");
- rOutDev.SetMapMode(MapMode(MapUnit::Map100thMM)); // format for 100% always
+ rOutDev.SetMapMode(MapMode(SmMapUnit())); // format for 100% always
}
}
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 09f00170bca9..98858f6d88d0 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -482,7 +482,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
if(nVal < 1)
throw IllegalArgumentException();
Size aSize = aFormat.GetBaseSize();
- aSize.setHeight(o3tl::convert(nVal, o3tl::Length::pt, o3tl::Length::mm100));
+ aSize.setHeight(o3tl::convert(nVal, o3tl::Length::pt, SmO3tlLengthUnit()));
aFormat.SetBaseSize(aSize);
// apply base size to fonts
@@ -732,7 +732,7 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu
{
// Point!
*pValue <<= sal_Int16(o3tl::convert(aFormat.GetBaseSize().Height(),
- o3tl::Length::mm100, o3tl::Length::pt));
+ SmO3tlLengthUnit(), o3tl::Length::pt));
}
break;
case HANDLE_RELATIVE_FONT_HEIGHT_TEXT :
@@ -987,7 +987,7 @@ void SAL_CALL SmModel::render(
if (!pOut)
throw RuntimeException();
- pOut->SetMapMode(MapMode(MapUnit::Map100thMM));
+ pOut->SetMapMode(MapMode(SmMapUnit()));
uno::Reference< frame::XModel > xModel;
rSelection >>= xModel;
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index 35680ed24b73..5c957899092e 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -203,7 +203,7 @@ void SmFace::SetSize(const Size& rSize)
Size aSize (rSize);
// check the requested size against minimum value
- constexpr int nMinVal = o3tl::convert(2, o3tl::Length::pt, o3tl::Length::mm100);
+ const int nMinVal = o3tl::convert(2, o3tl::Length::pt, SmO3tlLengthUnit());
if (aSize.Height() < nMinVal)
aSize.setHeight( nMinVal );
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 98397b55d4c7..43a80abe027e 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -307,9 +307,17 @@ void SmGraphicWidget::SetDrawingArea(weld::DrawingArea* pDrawingArea)
rDevice.SetBackground(SM_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor);
- const Fraction aFraction(1, 1);
- MapUnit unit = comphelper::LibreOfficeKit::isActive() ? MapUnit::MapPixel : MapUnit::Map100thMM;
- rDevice.SetMapMode(MapMode(unit, Point(), aFraction, aFraction));
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Disable map mode, so that it's possible to send mouse event coordinates
+ // directly in twips.
+ rDevice.EnableMapMode(false);
+ }
+ else
+ {
+ const Fraction aFraction(1, 1);
+ rDevice.SetMapMode(MapMode(SmMapUnit(), Point(), aFraction, aFraction));
+ }
SetTotalSize();
@@ -801,9 +809,11 @@ bool SmGraphicWidget::Command(const CommandEvent& rCEvt)
void SmGraphicWindow::SetZoom(sal_uInt16 Factor)
{
+ if (comphelper::LibreOfficeKit::isActive())
+ return;
nZoom = std::clamp(Factor, MINZOOM, MAXZOOM);
Fraction aFraction(nZoom, 100);
- SetGraphicMapMode(MapMode(MapUnit::Map100thMM, Point(), aFraction, aFraction));
+ SetGraphicMapMode(MapMode(SmMapUnit(), Point(), aFraction, aFraction));
mxGraphic->SetTotalSize();
SmViewShell& rViewSh = mxGraphic->GetView();
rViewSh.GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOM);
@@ -813,7 +823,7 @@ void SmGraphicWindow::SetZoom(sal_uInt16 Factor)
void SmGraphicWindow::ZoomToFitInWindow()
{
// set defined mapmode before calling 'LogicToPixel' below
- SetGraphicMapMode(MapMode(MapUnit::Map100thMM));
+ SetGraphicMapMode(MapMode(SmMapUnit()));
assert(mxGraphic->GetDoc());
Size aSize(mxGraphic->GetOutputDevice().LogicToPixel(mxGraphic->GetDoc()->GetSize()));
@@ -1101,7 +1111,7 @@ void SmViewShell::InnerResizePixel(const Point &rOfs, const Size &rSize, bool)
Size aObjSize = GetObjectShell()->GetVisArea().GetSize();
if ( !aObjSize.IsEmpty() )
{
- Size aProvidedSize = GetWindow()->PixelToLogic(rSize, MapMode(MapUnit::Map100thMM));
+ Size aProvidedSize = GetWindow()->PixelToLogic(rSize, MapMode(SmMapUnit()));
Fraction aZoomX(aProvidedSize.Width(), aObjSize.Width());
Fraction aZoomY(aProvidedSize.Height(), aObjSize.Height());
MapMode aMap(mxGraphicWindow->GetGraphicMapMode());
@@ -1404,44 +1414,43 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri
switch (ePrintSize)
{
case PRINT_SIZE_NORMAL:
- OutputMapMode = MapMode(MapUnit::Map100thMM);
+ OutputMapMode = MapMode(SmMapUnit());
break;
case PRINT_SIZE_SCALED:
if (!aSize.IsEmpty())
{
- Size OutputSize (rOutDev.LogicToPixel(Size(aOutRect.GetWidth(),
- aOutRect.GetHeight()), MapMode(MapUnit::Map100thMM)));
- Size GraphicSize (rOutDev.LogicToPixel(aSize, MapMode(MapUnit::Map100thMM)));
- sal_uInt16 nZ = sal::static_int_cast<sal_uInt16>(std::min(tools::Long(Fraction(OutputSize.Width() * 100, GraphicSize.Width())),
- tools::Long(Fraction(OutputSize.Height() * 100, GraphicSize.Height()))));
+ Size OutputSize(rOutDev.LogicToPixel(aOutRect.GetSize(), MapMode(SmMapUnit())));
+ Size GraphicSize(rOutDev.LogicToPixel(aSize, MapMode(SmMapUnit())));
+ sal_uInt16 nZ = std::min(o3tl::convert(OutputSize.Width(), 100, GraphicSize.Width()),
+ o3tl::convert(OutputSize.Height(), 100, GraphicSize.Height()));
nZ -= 10;
- Fraction aFraction (std::clamp(nZ, MINZOOM, sal_uInt16(100)));
+ Fraction aFraction(std::clamp(nZ, MINZOOM, sal_uInt16(100)), 1);
- OutputMapMode = MapMode(MapUnit::Map100thMM, Point(), aFraction, aFraction);
+ OutputMapMode = MapMode(SmMapUnit(), Point(), aFraction, aFraction);
}
else
- OutputMapMode = MapMode(MapUnit::Map100thMM);
+ OutputMapMode = MapMode(SmMapUnit());
break;
case PRINT_SIZE_ZOOMED:
{
Fraction aFraction( nZoomFactor, 100 );
- OutputMapMode = MapMode(MapUnit::Map100thMM, Point(), aFraction, aFraction);
+ OutputMapMode = MapMode(SmMapUnit(), Point(), aFraction, aFraction);
break;
}
}
aSize = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aSize, OutputMapMode),
- MapMode(MapUnit::Map100thMM));
+ MapMode(SmMapUnit()));
Point aPos (aOutRect.Left() + (aOutRect.GetWidth() - aSize.Width()) / 2,
aOutRect.Top() + (aOutRect.GetHeight() - aSize.Height()) / 2);
- aPos = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aPos, MapMode(MapUnit::Map100thMM)),
+ aPos = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aPos, MapMode(SmMapUnit())),
OutputMapMode);
- aOutRect = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aOutRect, MapMode(MapUnit::Map100thMM)),
+ aOutRect = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aOutRect, MapMode(SmMapUnit())),
OutputMapMode);
rOutDev.SetMapMode(OutputMapMode);
@@ -2252,7 +2261,7 @@ void SmViewShell::ZoomByItemSet(const SfxItemSet *pSet)
case SvxZoomType::PAGEWIDTH:
case SvxZoomType::WHOLEPAGE:
{
- const MapMode aMap( MapUnit::Map100thMM );
+ const MapMode aMap( SmMapUnit() );
SfxPrinter *pPrinter = GetPrinter( true );
tools::Rectangle OutputRect(Point(), pPrinter->GetOutputSize());
Size OutputSize(pPrinter->LogicToPixel(Size(OutputRect.GetWidth(),