Kaydet (Commit) a1f31211 authored tarafından Caolán McNamara's avatar Caolán McNamara

remove 1 pixel white band in XRectPreview

Change-Id: I3089f9305b8142e2c78405a4f9ae6a2066e90cfa
Reviewed-on: https://gerrit.libreoffice.org/59725
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6dbae37b
......@@ -478,6 +478,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC XRectPreview : public PreviewBase
private:
SdrObject* mpRectangleObject;
tools::Rectangle GetPreviewSize() const;
public:
XRectPreview();
virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
......
......@@ -2270,27 +2270,36 @@ XRectPreview::XRectPreview()
{
}
// expand to avoid 1 pixel band to the right and bottom of previews
// in color/gradient/bitmap/pattern/hatch subpages of area tab
// in e.g. page dialog
tools::Rectangle XRectPreview::GetPreviewSize() const
{
tools::Rectangle aObjectSize(Point(), GetOutputSizePixel());
aObjectSize.AdjustRight(1);
aObjectSize.AdjustBottom(1);
return aObjectSize;
}
void XRectPreview::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
PreviewBase::SetDrawingArea(pDrawingArea);
InitSettings();
// create RectangleObject
const tools::Rectangle aObjectSize(Point(), GetOutputSizePixel());
mpRectangleObject = new SdrRectObj(
getModel(),
aObjectSize);
GetPreviewSize());
}
void XRectPreview::Resize()
{
const tools::Rectangle aObjectSize(Point(), GetOutputSizePixel());
SdrObject *pOrigObject = mpRectangleObject;
if (pOrigObject)
{
mpRectangleObject = new SdrRectObj(
getModel(),
aObjectSize);
GetPreviewSize());
SetAttributes(pOrigObject->GetMergedItemSet());
SdrObject::Free(pOrigObject);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment