This is an automated email from the ASF dual-hosted git repository. mseidel pushed a commit to branch AOO42X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 70f66fbb7c9812479df721fbbaea14aaea7370a9 Author: mseidel <[email protected]> AuthorDate: Sun Apr 9 13:10:17 2023 +0200 Back to 9x9 for gluepoint (cherry picked from commit 8cd3382f96de367db86a2b87d61cabbbab28a57e) --- .../source/sdr/primitive2d/sdrprimitivetools.cxx | 72 ++++++++++------------ main/svx/source/svdraw/svdglue.cxx | 53 ++++++++-------- 2 files changed, 60 insertions(+), 65 deletions(-) diff --git a/main/svx/source/sdr/primitive2d/sdrprimitivetools.cxx b/main/svx/source/sdr/primitive2d/sdrprimitivetools.cxx index 50dd41ee87..e8018ef55a 100644 --- a/main/svx/source/sdr/primitive2d/sdrprimitivetools.cxx +++ b/main/svx/source/sdr/primitive2d/sdrprimitivetools.cxx @@ -27,7 +27,6 @@ #include <osl/mutex.hxx> #include <vcl/lazydelete.hxx> -////////////////////////////////////////////////////////////////////////////// // helper methods namespace drawinglayer @@ -77,7 +76,7 @@ namespace drawinglayer return aRetVal.get() ? *aRetVal.get() : BitmapEx(); } -// TODO: Use the bitmap (Glue_Unselected) from markers*.png, so it will be part of the icon theme +// TODO: Use the bitmap (Glue_Unselected) from markers*.png instead, so it will be part of the icon theme BitmapEx createDefaultGluepoint_9x9(const basegfx::BColor& rBColorA, const basegfx::BColor& rBColorB) { static vcl::DeleteOnDeinit< BitmapEx > aRetVal(0); @@ -104,42 +103,74 @@ namespace drawinglayer const BitmapColor aMaskColor(0x01); // Y,X unusual order (!) + pWContent->SetPixel(0, 0, aPixColorA); + pWContent->SetPixel(0, 1, aPixColorA); + pWContent->SetPixel(0, 2, aPixColorA); + pWContent->SetPixel(0, 3, aPixColorA); + pWContent->SetPixel(0, 4, aPixColorA); + pWContent->SetPixel(0, 5, aPixColorA); + pWContent->SetPixel(0, 6, aPixColorA); + pWContent->SetPixel(0, 7, aPixColorA); + pWContent->SetPixel(0, 8, aPixColorA); + pWContent->SetPixel(1, 0, aPixColorA); pWContent->SetPixel(1, 2, aPixColorA); pWContent->SetPixel(1, 3, aPixColorA); pWContent->SetPixel(1, 4, aPixColorA); pWContent->SetPixel(1, 5, aPixColorA); pWContent->SetPixel(1, 6, aPixColorA); + pWContent->SetPixel(1, 8, aPixColorA); + pWContent->SetPixel(2, 0, aPixColorA); pWContent->SetPixel(2, 1, aPixColorA); pWContent->SetPixel(2, 3, aPixColorA); pWContent->SetPixel(2, 4, aPixColorA); pWContent->SetPixel(2, 5, aPixColorA); pWContent->SetPixel(2, 7, aPixColorA); + pWContent->SetPixel(2, 8, aPixColorA); + pWContent->SetPixel(3, 0, aPixColorA); pWContent->SetPixel(3, 1, aPixColorA); pWContent->SetPixel(3, 2, aPixColorA); pWContent->SetPixel(3, 4, aPixColorA); pWContent->SetPixel(3, 6, aPixColorA); pWContent->SetPixel(3, 7, aPixColorA); + pWContent->SetPixel(3, 8, aPixColorA); + pWContent->SetPixel(4, 0, aPixColorA); pWContent->SetPixel(4, 1, aPixColorA); pWContent->SetPixel(4, 2, aPixColorA); pWContent->SetPixel(4, 3, aPixColorA); pWContent->SetPixel(4, 5, aPixColorA); pWContent->SetPixel(4, 6, aPixColorA); pWContent->SetPixel(4, 7, aPixColorA); + pWContent->SetPixel(4, 8, aPixColorA); + pWContent->SetPixel(5, 0, aPixColorA); pWContent->SetPixel(5, 1, aPixColorA); pWContent->SetPixel(5, 2, aPixColorA); pWContent->SetPixel(5, 4, aPixColorA); pWContent->SetPixel(5, 6, aPixColorA); pWContent->SetPixel(5, 7, aPixColorA); + pWContent->SetPixel(5, 8, aPixColorA); + pWContent->SetPixel(6, 0, aPixColorA); pWContent->SetPixel(6, 1, aPixColorA); pWContent->SetPixel(6, 3, aPixColorA); pWContent->SetPixel(6, 4, aPixColorA); pWContent->SetPixel(6, 5, aPixColorA); pWContent->SetPixel(6, 7, aPixColorA); + pWContent->SetPixel(6, 8, aPixColorA); + pWContent->SetPixel(7, 0, aPixColorA); pWContent->SetPixel(7, 2, aPixColorA); pWContent->SetPixel(7, 3, aPixColorA); pWContent->SetPixel(7, 4, aPixColorA); pWContent->SetPixel(7, 5, aPixColorA); pWContent->SetPixel(7, 6, aPixColorA); + pWContent->SetPixel(7, 8, aPixColorA); + pWContent->SetPixel(8, 0, aPixColorA); + pWContent->SetPixel(8, 1, aPixColorA); + pWContent->SetPixel(8, 2, aPixColorA); + pWContent->SetPixel(8, 3, aPixColorA); + pWContent->SetPixel(8, 4, aPixColorA); + pWContent->SetPixel(8, 5, aPixColorA); + pWContent->SetPixel(8, 6, aPixColorA); + pWContent->SetPixel(8, 7, aPixColorA); + pWContent->SetPixel(8, 8, aPixColorA); pWContent->SetPixel(1, 1, aPixColorB); pWContent->SetPixel(1, 7, aPixColorB); @@ -155,40 +186,6 @@ namespace drawinglayer pWContent->SetPixel(7, 1, aPixColorB); pWContent->SetPixel(7, 7, aPixColorB); - pWMask->SetPixel(0, 0, aMaskColor); - pWMask->SetPixel(0, 1, aMaskColor); - pWMask->SetPixel(0, 2, aMaskColor); - pWMask->SetPixel(0, 3, aMaskColor); - pWMask->SetPixel(0, 4, aMaskColor); - pWMask->SetPixel(0, 5, aMaskColor); - pWMask->SetPixel(0, 6, aMaskColor); - pWMask->SetPixel(0, 7, aMaskColor); - pWMask->SetPixel(0, 8, aMaskColor); - pWMask->SetPixel(1, 0, aMaskColor); - pWMask->SetPixel(1, 8, aMaskColor); - pWMask->SetPixel(2, 0, aMaskColor); - pWMask->SetPixel(2, 8, aMaskColor); - pWMask->SetPixel(3, 0, aMaskColor); - pWMask->SetPixel(3, 8, aMaskColor); - pWMask->SetPixel(4, 0, aMaskColor); - pWMask->SetPixel(4, 8, aMaskColor); - pWMask->SetPixel(5, 0, aMaskColor); - pWMask->SetPixel(5, 8, aMaskColor); - pWMask->SetPixel(6, 0, aMaskColor); - pWMask->SetPixel(6, 8, aMaskColor); - pWMask->SetPixel(7, 0, aMaskColor); - pWMask->SetPixel(7, 8, aMaskColor); - pWMask->SetPixel(8, 0, aMaskColor); - pWMask->SetPixel(8, 1, aMaskColor); - pWMask->SetPixel(8, 2, aMaskColor); - pWMask->SetPixel(8, 3, aMaskColor); - pWMask->SetPixel(8, 4, aMaskColor); - pWMask->SetPixel(8, 5, aMaskColor); - pWMask->SetPixel(8, 6, aMaskColor); - pWMask->SetPixel(8, 7, aMaskColor); - pWMask->SetPixel(8, 8, aMaskColor); - - aContent.ReleaseAccess(pWContent); aMask.ReleaseAccess(pWMask); @@ -202,5 +199,4 @@ namespace drawinglayer } // end of namespace primitive2d } // end of namespace drawinglayer -////////////////////////////////////////////////////////////////////////////// -// eof +/* vim: set noet sw=4 ts=4: */ diff --git a/main/svx/source/svdraw/svdglue.cxx b/main/svx/source/svdraw/svdglue.cxx index f4f920a6f3..d2765a38af 100644 --- a/main/svx/source/svdraw/svdglue.cxx +++ b/main/svx/source/svdraw/svdglue.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -29,23 +29,22 @@ #include <svx/svdobj.hxx> #include <svx/svdtrans.hxx> -//////////////////////////////////////////////////////////////////////////////////////////////////// void SdrGluePoint::SetReallyAbsolute(FASTBOOL bOn, const SdrObject& rObj) { if ( bReallyAbsolute != bOn ) { - if ( bOn ) - { - aPos=GetAbsolutePos(rObj); - bReallyAbsolute=bOn; - } - else - { - bReallyAbsolute=bOn; - Point aPt(aPos); - SetAbsolutePos(aPt,rObj); - } + if ( bOn ) + { + aPos=GetAbsolutePos(rObj); + bReallyAbsolute=bOn; + } + else + { + bReallyAbsolute=bOn; + Point aPt(aPos); + SetAbsolutePos(aPt,rObj); + } } } @@ -181,11 +180,11 @@ void SdrGluePoint::Rotate(const Point& rRef, long nWink, double sn, double cs, c Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos()); RotatePoint(aPt,rRef,sn,cs); // Bezugskante drehen - if(nAlign != (SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER)) + if(nAlign != (SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER)) { SetAlignAngle(GetAlignAngle()+nWink); } - // Austrittsrichtungen drehen + // rotate escape directions sal_uInt16 nEscDir0=nEscDir; sal_uInt16 nEscDir1=0; if ((nEscDir0&SDRESC_LEFT )!=0) nEscDir1|=EscAngleToDir(EscDirToAngle(SDRESC_LEFT )+nWink); @@ -208,13 +207,13 @@ void SdrGluePoint::Mirror(const Point& rRef1, const Point& rRef2, long nWink, co Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos()); MirrorPoint(aPt,rRef1,rRef2); // Bezugskante spiegeln - if(nAlign != (SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER)) + if(nAlign != (SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER)) { long nAW=GetAlignAngle(); nAW+=2*(nWink-nAW); SetAlignAngle(nAW); } - // Austrittsrichtungen spiegeln + // mirror escape directions sal_uInt16 nEscDir0=nEscDir; sal_uInt16 nEscDir1=0; if ((nEscDir0&SDRESC_LEFT)!=0) { @@ -248,6 +247,7 @@ void SdrGluePoint::Shear(const Point& rRef, long /*nWink*/, double tn, FASTBOOL if (pObj!=NULL) SetAbsolutePos(aPt,*pObj); else SetPos(aPt); } +// Unused code?! void SdrGluePoint::Draw(OutputDevice& rOut, const SdrObject* pObj) const { Color aBackPenColor(COL_WHITE); @@ -292,11 +292,11 @@ void SdrGluePoint::Invalidate(Window& rWin, const SdrObject* pObj) const Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos()); aPt=rWin.LogicToPixel(aPt); rWin.EnableMapMode(sal_False); - long x=aPt.X(),y=aPt.Y(); // Groesse erstmal fest auf 7 Pixel + long x=aPt.X(),y=aPt.Y(); // size 9x9 pixel // #111096# // do not erase background, that causes flicker (!) - rWin.Invalidate(Rectangle(Point(x-3,y-3),Point(x+3,y+3)), INVALIDATE_NOERASE); + rWin.Invalidate(Rectangle(Point(x-4,y-4),Point(x+4,y+4)), INVALIDATE_NOERASE); rWin.EnableMapMode(bMapMerk); } @@ -304,12 +304,11 @@ void SdrGluePoint::Invalidate(Window& rWin, const SdrObject* pObj) const FASTBOOL SdrGluePoint::IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const { Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos()); - Size aSiz=rOut.PixelToLogic(Size(3,3)); + Size aSiz=rOut.PixelToLogic(Size(4,4)); Rectangle aRect(aPt.X()-aSiz.Width(),aPt.Y()-aSiz.Height(),aPt.X()+aSiz.Width(),aPt.Y()+aSiz.Height()); return aRect.IsInside(rPnt); } -//////////////////////////////////////////////////////////////////////////////////////////////////// void SdrGluePointList::Clear() { @@ -375,8 +374,8 @@ void SdrGluePointList::Invalidate(Window& rWin, const SdrObject* pObj) const sal_uInt16 SdrGluePointList::FindGluePoint(sal_uInt16 nId) const { - // Hier noch einen optimaleren Suchalgorithmus implementieren. - // Die Liste sollte stets sortiert sein!!!! + // TODO: Hier noch einen optimaleren Suchalgorithmus implementieren. + // Die Liste sollte stets sortiert sein! sal_uInt16 nAnz=GetCount(); sal_uInt16 nRet=SDRGLUEPOINT_NOTFOUND; for (sal_uInt16 nNum=0; nNum<nAnz && nRet==SDRGLUEPOINT_NOTFOUND; nNum++) { @@ -443,4 +442,4 @@ void SdrGluePointList::Shear(const Point& rRef, long nWink, double tn, FASTBOOL } } -// eof +/* vim: set noet sw=4 ts=4: */
