summaryrefslogtreecommitdiffstats
path: root/ui/gfx/break_list.h
diff options
context:
space:
mode:
authorckocagil@chromium.org <ckocagil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-20 11:41:54 +0000
committerckocagil@chromium.org <ckocagil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-20 11:41:54 +0000
commit7c71dbfb0be07ce82670d9a10d340e87c95d9eff (patch)
treea51376a94d88e4f020d9c56d23d291bfe24eeef8 /ui/gfx/break_list.h
parent312593c8ee84950e079a298f3edeee2298389410 (diff)
downloadchromium_src-7c71dbfb0be07ce82670d9a10d340e87c95d9eff.zip
chromium_src-7c71dbfb0be07ce82670d9a10d340e87c95d9eff.tar.gz
chromium_src-7c71dbfb0be07ce82670d9a10d340e87c95d9eff.tar.bz2
Colors shouldn't break runs and should be handled while drawing the text
BUG=262119,256908 TEST=In a views textfield, selecting half of a ligature shouldn't break the ligature. See http://www.catch22.net/tuts/uniscribe-mysteries in Firefox to see a example of how it used to look versus how it is supposed to look. TBR=asvitkine@chromium.org Review URL: https://chromiumcodereview.appspot.com/19672006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/break_list.h')
-rw-r--r--ui/gfx/break_list.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/gfx/break_list.h b/ui/gfx/break_list.h
index c380222..770386e 100644
--- a/ui/gfx/break_list.h
+++ b/ui/gfx/break_list.h
@@ -47,6 +47,7 @@ class BreakList {
// Get the break applicable to |position| (at or preceeding |position|).
typename std::vector<Break>::iterator GetBreak(size_t position);
+ typename std::vector<Break>::const_iterator GetBreak(size_t position) const;
// Get the range of the supplied break; returns the break's start position and
// the next break's start position (or |max_| for the terminal break).
@@ -126,6 +127,14 @@ typename std::vector<std::pair<size_t, T> >::iterator BreakList<T>::GetBreak(
}
template<class T>
+typename std::vector<std::pair<size_t, T> >::const_iterator
+ BreakList<T>::GetBreak(size_t position) const {
+ typename std::vector<Break>::const_iterator i = breaks_.end() - 1;
+ for (; i != breaks_.begin() && i->first > position; --i);
+ return i;
+}
+
+template<class T>
ui::Range BreakList<T>::GetRange(
const typename BreakList<T>::const_iterator& i) const {
const typename BreakList<T>::const_iterator next = i + 1;