tdf#97919 Resize media objects proportionally by default
as we do with images Change-Id: I5b27b8310736b9dfd5c274614ad4d1e4becb1fa9 Reviewed-on: https://gerrit.libreoffice.org/23277 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
@@ -290,16 +290,15 @@ bool FuPoor::doConstructOrthogonal() const
|
||||
}
|
||||
}
|
||||
|
||||
// Detect image and resize proportionally, but don't constrain movement by default
|
||||
// Detect image/media and resize proportionally, but don't constrain movement by default
|
||||
if (pView->AreObjectsMarked())
|
||||
{
|
||||
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
|
||||
if (rMarkList.GetMarkCount() == 1)
|
||||
{
|
||||
if (rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier() == OBJ_GRAF)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
sal_uInt16 aObjIdentifier = rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier();
|
||||
return aObjIdentifier == OBJ_GRAF ||
|
||||
aObjIdentifier == OBJ_MEDIA;
|
||||
}
|
||||
}
|
||||
else if (aSfxRequest.GetSlot() == SID_DRAW_XPOLYGON || aSfxRequest.GetSlot() == SID_DRAW_XPOLYGON_NOFILL)
|
||||
|
@@ -78,7 +78,7 @@ FuDraw::FuDraw(ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView,
|
||||
, bDragHelpLine(false)
|
||||
, nHelpLine(0)
|
||||
, bPermanent(false)
|
||||
, bIsImageSelected(false)
|
||||
, bIsMediaSelected(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -155,8 +155,8 @@ bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
|
||||
bDragHelpLine = false;
|
||||
aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
|
||||
|
||||
// Check whether an image is selected
|
||||
bIsImageSelected = false;
|
||||
// Check whether a media object is selected
|
||||
bIsMediaSelected = false;
|
||||
if (mpView->AreObjectsMarked())
|
||||
{
|
||||
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
||||
@@ -167,7 +167,9 @@ bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
|
||||
// proportionally scaled by default.
|
||||
if (mpView->GetDragMode() != SDRDRAG_CROP)
|
||||
{
|
||||
bIsImageSelected = pMark->GetMarkedSdrObj()->GetObjIdentifier() == OBJ_GRAF;
|
||||
sal_uInt16 aObjIdentifier = pMark->GetMarkedSdrObj()->GetObjIdentifier();
|
||||
bIsMediaSelected = aObjIdentifier == OBJ_GRAF ||
|
||||
aObjIdentifier == OBJ_MEDIA;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,7 +261,7 @@ bool FuDraw::MouseMove(const MouseEvent& rMEvt)
|
||||
if (mpView->IsAction())
|
||||
{
|
||||
// #i33136# and fdo#88339
|
||||
if(bRestricted && (bIsImageSelected || doConstructOrthogonal()))
|
||||
if(bRestricted && (bIsMediaSelected || doConstructOrthogonal()))
|
||||
{
|
||||
// Scale proportionally by default:
|
||||
// rectangle->quadrat, ellipse->circle, Images etc.
|
||||
|
@@ -77,7 +77,7 @@ protected:
|
||||
bool bDragHelpLine;
|
||||
sal_uInt16 nHelpLine;
|
||||
bool bPermanent;
|
||||
bool bIsImageSelected;
|
||||
bool bIsMediaSelected;
|
||||
|
||||
private:
|
||||
void DoModifiers(const MouseEvent& rMEvt, bool bSnapModPressed);
|
||||
|
@@ -4079,7 +4079,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
|
||||
if( bIsDocReadOnly )
|
||||
break;
|
||||
|
||||
bool bIsSelectionGfx = rSh.GetSelectionType() & nsSelectionType::SEL_GRF;
|
||||
bool bIsMediaSelected = rSh.GetSelectionType() & nsSelectionType::SEL_GRF ||
|
||||
rSh.GetSelectionType() & nsSelectionType::SEL_MEDIA;
|
||||
bool bisResize = g_eSdrMoveHdl != HDL_MOVE;
|
||||
|
||||
if (pSdrView)
|
||||
@@ -4089,17 +4090,17 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
|
||||
|
||||
if (rMEvt.IsShift())
|
||||
{
|
||||
pSdrView->SetAngleSnapEnabled(!bIsSelectionGfx);
|
||||
pSdrView->SetAngleSnapEnabled(!bIsMediaSelected);
|
||||
if (bisResize)
|
||||
pSdrView->SetOrtho(!bIsSelectionGfx);
|
||||
pSdrView->SetOrtho(!bIsMediaSelected);
|
||||
else
|
||||
pSdrView->SetOrtho(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
pSdrView->SetAngleSnapEnabled(bIsSelectionGfx);
|
||||
pSdrView->SetAngleSnapEnabled(bIsMediaSelected);
|
||||
if (bisResize)
|
||||
pSdrView->SetOrtho(bIsSelectionGfx);
|
||||
pSdrView->SetOrtho(bIsMediaSelected);
|
||||
else
|
||||
pSdrView->SetOrtho(false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user