Skip to content

Commit

Permalink
Merge branch 'Vertical' into Linebreak
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw authored Aug 23, 2020
2 parents 9b152de + 8f58be6 commit be06ae8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SquirrelPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ - (void)drawRect:(NSRect)dirtyRect {
candidateRect.size.height -= preeditRect.size.height;
candidateRect.origin.y += preeditRect.size.height;
makeRoomForConor(&highlightedRect, candidateRect, _hilitedCornerRadius / 2);

}
highlightedPath = drawSmoothLines(rectVertex(highlightedRect), _hilitedCornerRadius*0.3, _hilitedCornerRadius*1.4);
}
Expand Down Expand Up @@ -685,6 +686,7 @@ @implementation SquirrelPanel {
NSMutableDictionary *_preeditHighlightedAttrs;
NSParagraphStyle *_paragraphStyle ;
NSParagraphStyle *_preeditParagraphStyle;

CGFloat alphaValue;
NSMutableDictionary *_attrsDark;
NSMutableDictionary *_highlightedAttrsDark;
Expand All @@ -705,6 +707,7 @@ @implementation SquirrelPanel {
NSTimer *_statusTimer;
}


// Use this method to convert charcters to upright position
// Based on the width of the chacter, relative font size matters
- (void)convertToVerticalGlyph:(NSMutableAttributedString *)originalText inRange:(NSRange)stringRange attribute:(NSDictionary *)attribute {
Expand Down Expand Up @@ -838,6 +841,7 @@ - (void)show {
BOOL vertical = [_view.styles[@"vertical"] boolValue];
if (_view.isDark) {
edgeInset = [_view.darkStyles[@"edgeInset"] sizeValue];
vertical = [_view.darkStyles[@"vertical"] boolValue];
}

//Break line if the text is too long, based on screen size.
Expand Down Expand Up @@ -938,6 +942,7 @@ - (void)showPreedit:(NSString *)preedit
comments:(NSArray *)comments
labels:(NSArray *)labels
highlighted:(NSUInteger)index {
[self getCurrentScreen];
NSUInteger numCandidates = candidates.count;
if (numCandidates || (preedit && preedit.length)) {
_statusMessage = nil;
Expand Down Expand Up @@ -1166,7 +1171,7 @@ - (void)showPreedit:(NSString *)preedit
if (i > 0) {
[text appendAttributedString:separator];
}

if (vertical) {
[self convertToVerticalGlyph:line inRange:NSMakeRange(candidateStart, line.length-candidateStart) attribute:attrsCan];
}
Expand Down

0 comments on commit be06ae8

Please sign in to comment.