OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. | 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 if (!m_run.rtl()) | 1139 if (!m_run.rtl()) |
1140 currentX += m_harfBuzzRuns[i]->width(); | 1140 currentX += m_harfBuzzRuns[i]->width(); |
1141 } | 1141 } |
1142 | 1142 |
1143 // The position in question might be just after the text. | 1143 // The position in question might be just after the text. |
1144 if (!foundFromX) | 1144 if (!foundFromX) |
1145 fromX = 0; | 1145 fromX = 0; |
1146 if (!foundToX) | 1146 if (!foundToX) |
1147 toX = m_run.rtl() ? 0 : m_totalWidth; | 1147 toX = m_run.rtl() ? 0 : m_totalWidth; |
1148 | 1148 |
1149 if (fromX < toX) { | 1149 if (fromX < toX) |
1150 return Font::pixelSnappedSelectionRect( | 1150 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); |
1151 point.x() + fromX, point.x() + toX, | 1151 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); |
1152 point.y(), height); | |
1153 } | |
1154 | |
1155 return Font::pixelSnappedSelectionRect( | |
1156 point.x() + toX, point.x() + fromX, | |
1157 point.y(), height); | |
1158 } | 1152 } |
1159 | 1153 |
1160 } // namespace blink | 1154 } // namespace blink |
OLD | NEW |