Skip to content

Commit

Permalink
Do not extend the last hilighted block, allow 0 alpha value
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw committed May 27, 2022
1 parent bedc952 commit 54f3d57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SquirrelPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ - (void)multilineRectForRange:(NSRange)charRange leadingRect:(NSRect *)leadingRe
}
}
NSRect lastLineRect = nearEmptyRect(*trailingRect) ? *bodyRect : *trailingRect;
lastLineRect.size.width = textContainer.containerSize.width - lastLineRect.origin.x;
// lastLineRect.size.width = textContainer.containerSize.width - lastLineRect.origin.x;
NSRange lastLineRange = [layoutManager glyphRangeForBoundingRect:lastLineRect inTextContainer:textContainer];
NSGlyphProperty glyphProperty = [layoutManager propertyForGlyphAtIndex:lastLineRange.location+lastLineRange.length-1];
while (lastLineRange.length>0 && (glyphProperty == NSGlyphPropertyElastic || glyphProperty == NSGlyphPropertyControlCharacter)) {
Expand Down Expand Up @@ -578,9 +578,9 @@ void enlarge(NSMutableArray<NSValue *> *vertex, CGFloat by) {

// Add gap between horizontal candidates
- (void)addGapBetweenHorizontalCandidates:(NSRect *)rect range:(NSRange)highlightedRange {
if (highlightedRange.location+highlightedRange.length == _text.length) {
if (NSMaxRange(highlightedRange) == _text.length) {
if (!nearEmptyRect(*rect)) {
rect->size.width += _seperatorWidth / 2;
rect->size.width += _seperatorWidth;
rect->origin.x -= _seperatorWidth / 2;
}
} else if (highlightedRange.location - ((_preeditRange.location == NSNotFound ? 0 : _preeditRange.location)+_preeditRange.length) <= 1) {
Expand Down Expand Up @@ -1897,7 +1897,7 @@ +(void)updateTheme:(SquirrelTheme *)theme withConfig:(SquirrelConfig *)config fo
borderWidth:MIN(borderHeight, borderWidth)
linespace:lineSpacing
preeditLinespace:spacing
alpha:(alpha == 0 ? 1.0 : alpha)
alpha:alpha
translucency:translucency
linear:linear
vertical:vertical
Expand Down

0 comments on commit 54f3d57

Please sign in to comment.