From aee5ff8935766999ce41ea9cb9139af5bf166d22 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 2 Apr 2022 22:37:24 +0100 Subject: [PATCH] Make sure text caches get updated on move. Fixes https://gitlab.com/kicad/code/kicad/issues/11319 --- pcbnew/fp_textbox.cpp | 7 +++++++ pcbnew/fp_textbox.h | 2 ++ pcbnew/pcb_textbox.cpp | 7 +++++++ pcbnew/pcb_textbox.h | 2 ++ 4 files changed, 18 insertions(+) diff --git a/pcbnew/fp_textbox.cpp b/pcbnew/fp_textbox.cpp index b48d3b3da8..a4e09d6daa 100644 --- a/pcbnew/fp_textbox.cpp +++ b/pcbnew/fp_textbox.cpp @@ -178,6 +178,13 @@ bool FP_TEXTBOX::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy } +void FP_TEXTBOX::Move( const VECTOR2I& aMoveVector ) +{ + FP_SHAPE::Move( aMoveVector ); + EDA_TEXT::Offset( aMoveVector ); +} + + void FP_TEXTBOX::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) { FP_SHAPE::Rotate( aRotCentre, aAngle ); diff --git a/pcbnew/fp_textbox.h b/pcbnew/fp_textbox.h index 35c6ed0e74..73be58872b 100644 --- a/pcbnew/fp_textbox.h +++ b/pcbnew/fp_textbox.h @@ -79,6 +79,8 @@ public: std::vector GetAnchorAndOppositeCorner() const; + void Move( const VECTOR2I& aMoveVector ) override; + /// Rotate text, in footprint editor /// (for instance in footprint rotation transform) void Rotate( const VECTOR2I& aOffset, const EDA_ANGLE& aAngle ) override; diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index 7b1a5ea487..350e8ebe4a 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -247,6 +247,13 @@ void PCB_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector GetAnchorAndOppositeCorner() const; + void Move( const VECTOR2I& aMoveVector ) override; + void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override; void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;