mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2025-01-04 15:31:01 +00:00
Fixed rectangle style setting if segment has an incomplete last line
This commit is contained in:
parent
510366051c
commit
32d3e0de76
@ -753,7 +753,12 @@ class DefaultSegment(object):
|
||||
r = r2 - r1
|
||||
c = c2 - c1
|
||||
indexes = np.tile(np.arange(c), r) + np.repeat(np.arange(r) * bytes_per_row, c) + start
|
||||
s[indexes] |= style_bits
|
||||
|
||||
# Limit the indexes actually used to the size of the array, because
|
||||
# if the region has an incomplete last line, the style setting
|
||||
# would fail because it isn't be a perfect rectangle
|
||||
clamped = indexes[np.where(np.less(indexes, len(self)))[0]]
|
||||
s[clamped] |= style_bits
|
||||
|
||||
def rects_to_ranges(self, rects, bytes_per_row):
|
||||
ranges = []
|
||||
|
Loading…
Reference in New Issue
Block a user