OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 SVGMarkerElement* marker = toSVGMarkerElement(element()); | 108 SVGMarkerElement* marker = toSVGMarkerElement(element()); |
109 ASSERT(marker); | 109 ASSERT(marker); |
110 | 110 |
111 float angle = -1; | 111 float angle = -1; |
112 if (marker->orientType()->currentValue()->enumValue() == SVGMarkerOrientAngl e) | 112 if (marker->orientType()->currentValue()->enumValue() == SVGMarkerOrientAngl e) |
113 angle = marker->orientAngle()->currentValue()->value(); | 113 angle = marker->orientAngle()->currentValue()->value(); |
114 | 114 |
115 return angle; | 115 return angle; |
116 } | 116 } |
117 | 117 |
118 AffineTransform RenderSVGResourceMarker::markerTransformation(const FloatPoint& origin, float autoAngle, float strokeWidth) const | 118 AffineTransform RenderSVGResourceMarker::markerTransformation(const FloatPoint& origin, float autoAngle, float strokeWidth, bool isStartMarker) const |
119 { | 119 { |
120 SVGMarkerElement* marker = toSVGMarkerElement(element()); | 120 SVGMarkerElement* marker = toSVGMarkerElement(element()); |
121 ASSERT(marker); | 121 ASSERT(marker); |
122 | 122 |
123 float markerAngle = angle(); | 123 float markerAngle = angle(); |
124 bool useStrokeWidth = marker->markerUnits()->currentValue()->enumValue() == SVGMarkerUnitsStrokeWidth; | 124 bool useStrokeWidth = marker->markerUnits()->currentValue()->enumValue() == SVGMarkerUnitsStrokeWidth; |
125 | 125 if (markerAngle == -1) { |
126 markerAngle = autoAngle; | |
127 if (isStartMarker && marker->orientType()->currentValue()->enumValue() = = SVGMarkerOrientAutoStartReverse) | |
128 markerAngle += 180; | |
fs
2014/09/09 12:18:21
I'm curious if this (adjustment) would be nicer in
| |
129 } | |
126 AffineTransform transform; | 130 AffineTransform transform; |
127 transform.translate(origin.x(), origin.y()); | 131 transform.translate(origin.x(), origin.y()); |
128 transform.rotate(markerAngle == -1 ? autoAngle : markerAngle); | 132 transform.rotate(markerAngle); |
129 transform = markerContentTransformation(transform, referencePoint(), useStro keWidth ? strokeWidth : -1); | 133 transform = markerContentTransformation(transform, referencePoint(), useStro keWidth ? strokeWidth : -1); |
130 return transform; | 134 return transform; |
131 } | 135 } |
132 | 136 |
133 void RenderSVGResourceMarker::draw(PaintInfo& paintInfo, const AffineTransform& transform) | 137 void RenderSVGResourceMarker::draw(PaintInfo& paintInfo, const AffineTransform& transform) |
134 { | 138 { |
135 clearInvalidationMask(); | 139 clearInvalidationMask(); |
136 | 140 |
137 // An empty viewBox disables rendering. | 141 // An empty viewBox disables rendering. |
138 SVGMarkerElement* marker = toSVGMarkerElement(element()); | 142 SVGMarkerElement* marker = toSVGMarkerElement(element()); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 SVGMarkerElement* marker = toSVGMarkerElement(element()); | 182 SVGMarkerElement* marker = toSVGMarkerElement(element()); |
179 ASSERT(marker); | 183 ASSERT(marker); |
180 | 184 |
181 SVGLengthContext lengthContext(marker); | 185 SVGLengthContext lengthContext(marker); |
182 float w = marker->markerWidth()->currentValue()->value(lengthContext); | 186 float w = marker->markerWidth()->currentValue()->value(lengthContext); |
183 float h = marker->markerHeight()->currentValue()->value(lengthContext); | 187 float h = marker->markerHeight()->currentValue()->value(lengthContext); |
184 m_viewport = FloatRect(0, 0, w, h); | 188 m_viewport = FloatRect(0, 0, w, h); |
185 } | 189 } |
186 | 190 |
187 } | 191 } |
OLD | NEW |