OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 size_t end = wordLength; | 1019 size_t end = wordLength; |
1020 for (size_t start : hyphenLocations) { | 1020 for (size_t start : hyphenLocations) { |
1021 float fragmentWidth = font.getCharacterRange(run, start, end).width(); | 1021 float fragmentWidth = font.getCharacterRange(run, start, end).width(); |
1022 | 1022 |
1023 if (fragmentWidth <= minimumFragmentWidthToConsider) | 1023 if (fragmentWidth <= minimumFragmentWidthToConsider) |
1024 continue; | 1024 continue; |
1025 | 1025 |
1026 maxFragmentWidth = std::max(maxFragmentWidth, fragmentWidth); | 1026 maxFragmentWidth = std::max(maxFragmentWidth, fragmentWidth); |
1027 end = start; | 1027 end = start; |
1028 } | 1028 } |
1029 suffixStart = hyphenLocations.first(); | 1029 suffixStart = hyphenLocations.front(); |
1030 return maxFragmentWidth + layoutText->hyphenWidth(font, textDirection); | 1030 return maxFragmentWidth + layoutText->hyphenWidth(font, textDirection); |
1031 } | 1031 } |
1032 | 1032 |
1033 void LayoutText::computePreferredLogicalWidths( | 1033 void LayoutText::computePreferredLogicalWidths( |
1034 float leadWidth, | 1034 float leadWidth, |
1035 HashSet<const SimpleFontData*>& fallbackFonts, | 1035 HashSet<const SimpleFontData*>& fallbackFonts, |
1036 FloatRect& glyphBounds) { | 1036 FloatRect& glyphBounds) { |
1037 ASSERT(m_hasTab || preferredLogicalWidthsDirty() || | 1037 ASSERT(m_hasTab || preferredLogicalWidthsDirty() || |
1038 !m_knownToHaveNoOverflowAndNoFallbackFonts); | 1038 !m_knownToHaveNoOverflowAndNoFallbackFonts); |
1039 | 1039 |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 LayoutRect rect = LayoutRect( | 1974 LayoutRect rect = LayoutRect( |
1975 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height())); | 1975 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height())); |
1976 LayoutBlock* block = containingBlock(); | 1976 LayoutBlock* block = containingBlock(); |
1977 if (block && hasTextBoxes()) | 1977 if (block && hasTextBoxes()) |
1978 block->adjustChildDebugRect(rect); | 1978 block->adjustChildDebugRect(rect); |
1979 | 1979 |
1980 return rect; | 1980 return rect; |
1981 } | 1981 } |
1982 | 1982 |
1983 } // namespace blink | 1983 } // namespace blink |
OLD | NEW |