Merge lp:~cern-kicad/kicad/aligned_text_fix into lp:kicad/product

Proposed by Maciej Suminski
Status: Merged
Merged at revision: 4563
Proposed branch: lp:~cern-kicad/kicad/aligned_text_fix
Merge into: lp:kicad/product
Diff against target: 79 lines (+1/-42)
3 files modified
common/gal/stroke_font.cpp (+1/-2)
pcbnew/class_pcb_text.cpp (+0/-37)
pcbnew/class_pcb_text.h (+0/-3)
To merge this branch: bzr merge lp:~cern-kicad/kicad/aligned_text_fix
Reviewer Review Type Date Requested Status
KiCad Lead Developers Pending
Review via email: mp+199774@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'common/gal/stroke_font.cpp'
2--- common/gal/stroke_font.cpp 2013-12-08 06:48:25 +0000
3+++ common/gal/stroke_font.cpp 2013-12-20 10:07:46 +0000
4@@ -153,6 +153,7 @@
5 m_gal->Save();
6
7 m_gal->Translate( aPosition );
8+ m_gal->Rotate( -aRotationAngle );
9
10 // Single line height
11 int lineHeight = getInterline();
12@@ -177,8 +178,6 @@
13 break;
14 }
15
16- m_gal->Rotate( -aRotationAngle );
17-
18 m_gal->SetIsStroke( true );
19 m_gal->SetIsFill( false );
20
21
22=== modified file 'pcbnew/class_pcb_text.cpp'
23--- pcbnew/class_pcb_text.cpp 2013-12-05 12:24:27 +0000
24+++ pcbnew/class_pcb_text.cpp 2013-12-20 10:07:46 +0000
25@@ -205,40 +205,3 @@
26 {
27 return new TEXTE_PCB( *this );
28 }
29-
30-
31-const BOX2I TEXTE_PCB::ViewBBox() const
32-{
33- EDA_RECT rect = GetTextBox();
34-
35- if( m_Orient != 0.0 )
36- {
37- // If the text is rotated, we need to take it into account
38- wxPoint p1 = rect.GetOrigin();
39- wxPoint p2 = wxPoint( p1.x + rect.GetWidth(), p1.y );
40- wxPoint p3 = rect.GetEnd();
41- wxPoint p4 = wxPoint( p1.x, p1.y + rect.GetHeight() );
42-
43- // Transform all the corners of the bounding box according to the rotation angle
44- RotatePoint( &p1, m_Pos, -m_Orient );
45- RotatePoint( &p2, m_Pos, -m_Orient );
46- RotatePoint( &p3, m_Pos, -m_Orient );
47- RotatePoint( &p4, m_Pos, -m_Orient );
48-
49- // Find the new bounding box origin and dimensions
50- int minX = std::min( std::min( p1.x, p2.x ), std::min( p3.x, p4.x ) );
51- int minY = std::min( std::min( p1.y, p2.y ), std::min( p3.y, p4.y ) );
52- int maxX = std::max( std::max( p1.x, p2.x ), std::max( p3.x, p4.x ) );
53- int maxY = std::max( std::max( p1.y, p2.y ), std::max( p3.y, p4.y ) );
54-
55- int width = maxX - minX;
56- int height = maxY - minY;
57-
58- return BOX2I( VECTOR2I( minX, minY ), VECTOR2I( width, height ) );
59- }
60- else
61- {
62- return BOX2I( rect.GetOrigin(), rect.GetSize() );
63- }
64-}
65-
66
67=== modified file 'pcbnew/class_pcb_text.h'
68--- pcbnew/class_pcb_text.h 2013-12-05 12:24:27 +0000
69+++ pcbnew/class_pcb_text.h 2013-12-20 10:07:46 +0000
70@@ -135,9 +135,6 @@
71
72 EDA_ITEM* Clone() const;
73
74- /// @copydoc VIEW_ITEM::ViewBBox()
75- virtual const BOX2I ViewBBox() const;
76-
77 #if defined(DEBUG)
78 virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
79 #endif