OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void setViewBox(const FloatRect&); | 58 void setViewBox(const FloatRect&); |
59 void setPreserveAspectRatio(const SVGPreserveAspectRatio&); | 59 void setPreserveAspectRatio(const SVGPreserveAspectRatio&); |
60 | 60 |
61 Member<SVGRect> m_viewBox; | 61 Member<SVGRect> m_viewBox; |
62 Member<SVGPreserveAspectRatio> m_preserveAspectRatio; | 62 Member<SVGPreserveAspectRatio> m_preserveAspectRatio; |
63 Member<SVGTransformList> m_transform; | 63 Member<SVGTransformList> m_transform; |
64 }; | 64 }; |
65 | 65 |
66 template <typename T> | 66 template <typename T> |
67 void SVGViewSpec::inheritViewAttributesFromElement(T& inheritFromElement) { | 67 void SVGViewSpec::inheritViewAttributesFromElement(T& inheritFromElement) { |
68 if (!inheritFromElement.hasEmptyViewBox()) | 68 if (inheritFromElement.viewBox()->currentValue()->isValid()) |
69 setViewBox(inheritFromElement.viewBox()->currentValue()->value()); | 69 setViewBox(inheritFromElement.viewBox()->currentValue()->value()); |
70 | 70 |
71 if (inheritFromElement.preserveAspectRatio()->isSpecified()) { | 71 if (inheritFromElement.preserveAspectRatio()->isSpecified()) { |
72 setPreserveAspectRatio( | 72 setPreserveAspectRatio( |
73 *inheritFromElement.preserveAspectRatio()->currentValue()); | 73 *inheritFromElement.preserveAspectRatio()->currentValue()); |
74 } | 74 } |
75 | 75 |
76 if (inheritFromElement.hasAttribute(SVGNames::zoomAndPanAttr)) | 76 if (inheritFromElement.hasAttribute(SVGNames::zoomAndPanAttr)) |
77 setZoomAndPan(inheritFromElement.zoomAndPan()); | 77 setZoomAndPan(inheritFromElement.zoomAndPan()); |
78 } | 78 } |
79 | 79 |
80 } // namespace blink | 80 } // namespace blink |
81 | 81 |
82 #endif // SVGViewSpec_h | 82 #endif // SVGViewSpec_h |
OLD | NEW |