diff options
-rw-r--r-- | src/RunStyles.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx index 286734e9b..76174fea4 100644 --- a/src/RunStyles.cxx +++ b/src/RunStyles.cxx @@ -130,11 +130,13 @@ bool RunStyles::FillRange(int &position, int value, int &fillLength) { if (styles->ValueAt(runStart) == value) { // Start is in expected value so trim range. runStart++; - position = starts->PositionFromPartition(runStart); + position = starts->PositionFromPartition(runStart); fillLength = end - position; } else { - runStart = SplitRun(position); - runEnd++; + if (starts->PositionFromPartition(runStart) < position) { + runStart = SplitRun(position); + runEnd++; + } } styles->SetValueAt(runStart, value); // Remove each old run over the range |