| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2008 Holger Hans Peter Freyther | 6 * Copyright (C) 2008 Holger Hans Peter Freyther |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 void setFromBounds(const FloatRect& bounds, | 47 void setFromBounds(const FloatRect& bounds, |
| 48 float ascent, | 48 float ascent, |
| 49 float descent, | 49 float descent, |
| 50 float textWidth) { | 50 float textWidth) { |
| 51 top = std::max(0.0f, -bounds.y() - ascent); | 51 top = std::max(0.0f, -bounds.y() - ascent); |
| 52 bottom = std::max(0.0f, bounds.maxY() - descent); | 52 bottom = std::max(0.0f, bounds.maxY() - descent); |
| 53 left = std::max(0.0f, -bounds.x()); | 53 left = std::max(0.0f, -bounds.x()); |
| 54 right = std::max(0.0f, bounds.maxX() - textWidth); | 54 right = std::max(0.0f, bounds.maxX() - textWidth); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Top and bottom are the amounts of glyph overflows exceeding the font metric
s' ascent and descent, respectively. | 57 // Top and bottom are the amounts of glyph overflows exceeding the font |
| 58 // Left and right are the amounts of glyph overflows exceeding the left and ri
ght edge of normal layout boundary, respectively. | 58 // metrics' ascent and descent, respectively. Left and right are the amounts |
| 59 // of glyph overflows exceeding the left and right edge of normal layout |
| 60 // boundary, respectively. |
| 59 float left; | 61 float left; |
| 60 float right; | 62 float right; |
| 61 float top; | 63 float top; |
| 62 float bottom; | 64 float bottom; |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 } // namespace blink | 67 } // namespace blink |
| 66 | 68 |
| 67 #endif // GlyphOverflow_h | 69 #endif // GlyphOverflow_h |
| OLD | NEW |