Changeset 38785 in webkit
- Timestamp:
- Nov 26, 2008 7:07:30 AM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r38781 r38785 1 2008-11-26 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Simon Hausmann. 4 5 Transformations to the context shouldn't transform the currentPath. 6 Fixed this on Qt. 7 8 [QT] GraphicsContext's currenPath can be transformed 9 https://bugs.webkit.org/show_bug.cgi?id=22163 10 11 * platform/graphics/GraphicsContextPrivate.h: 12 * platform/graphics/qt/GraphicsContextQt.cpp: 13 (WebCore::GraphicsContext::restorePlatformState): 14 (WebCore::GraphicsContext::fillPath): 15 (WebCore::GraphicsContext::strokePath): 16 (WebCore::GraphicsContext::fillRect): 17 (WebCore::GraphicsContext::translate): 18 (WebCore::GraphicsContext::rotate): 19 (WebCore::GraphicsContext::scale): 20 (WebCore::GraphicsContext::concatCTM): 21 1 22 2008-11-26 Jan Michael Alonzo <jmalonzo@webkit.org> 2 23 -
trunk/WebCore/platform/graphics/GraphicsContextPrivate.h
r38001 r38785 27 27 #define GraphicsContextPrivate_h 28 28 29 #include "AffineTransform.h" 29 30 #include "Font.h" 30 31 #include "Gradient.h" … … 71 72 #if PLATFORM(CAIRO) 72 73 float globalAlpha; 74 #elif PLATFORM(QT) 75 AffineTransform pathTransform; 73 76 #endif 74 77 ColorSpace strokeColorSpace; -
trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r38618 r38785 294 294 { 295 295 m_data->p()->restore(); 296 297 if (!m_data->currentPath.isEmpty() && m_common->state.pathTransform.isInvertible()) { 298 QMatrix matrix = m_common->state.pathTransform; 299 m_data->currentPath = m_data->currentPath * matrix; 300 } 296 301 } 297 302 … … 545 550 break; 546 551 } 552 m_data->currentPath = QPainterPath(); 547 553 } 548 554 … … 577 583 } 578 584 } 585 m_data->currentPath = QPainterPath(); 579 586 } 580 587 … … 600 607 break; 601 608 } 609 m_data->currentPath = QPainterPath(); 602 610 } 603 611 … … 921 929 922 930 m_data->p()->translate(x, y); 931 932 if (!m_data->currentPath.isEmpty()) { 933 QMatrix matrix; 934 m_data->currentPath = m_data->currentPath * matrix.translate(-x, -y); 935 m_common->state.pathTransform.translate(x, y); 936 } 923 937 } 924 938 … … 937 951 938 952 m_data->p()->rotate(180/M_PI*radians); 953 954 if (!m_data->currentPath.isEmpty()) { 955 QMatrix matrix; 956 m_data->currentPath = m_data->currentPath * matrix.rotate(-180/M_PI*radians); 957 m_common->state.pathTransform.rotate(radians); 958 } 939 959 } 940 960 … … 945 965 946 966 m_data->p()->scale(s.width(), s.height()); 967 968 if (!m_data->currentPath.isEmpty()) { 969 QMatrix matrix; 970 m_data->currentPath = m_data->currentPath * matrix.scale(1 / s.width(), 1 / s.height()); 971 m_common->state.pathTransform.scale(s.width(), s.height()); 972 } 947 973 } 948 974 … … 1008 1034 1009 1035 m_data->p()->setMatrix(transform, true); 1036 1037 // Transformations to the context shouldn't transform the currentPath. 1038 // We have to undo every change made to the context from the currentPath to avoid wrong drawings. 1039 if (!m_data->currentPath.isEmpty() && transform.isInvertible()) { 1040 QMatrix matrix = transform.inverse(); 1041 m_data->currentPath = m_data->currentPath * matrix; 1042 m_common->state.pathTransform.multiply(transform); 1043 } 1010 1044 } 1011 1045
Note: See TracChangeset
for help on using the changeset viewer.