Skip to content

Commit b427b97

Browse files
committed
ANDROID: clip handling for drawlink
1 parent 3c3d4f6 commit b427b97

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/platform/common/ansiwidget.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,12 @@ void Widget::drawButton(const char *caption, int dx, int dy,
140140

141141
void Widget::drawLink(const char *caption, int dx, int dy, int sw, int chw) {
142142
maSetColor(_fg);
143-
144143
int len = strlen(caption);
145144
int width = min(sw, _width) - dx;
146-
if ((len * chw) > sw - width) {
145+
if ((len * chw) > width) {
147146
int len = width / chw;
148147
char *buffer = new char[len + 1];
149-
strncpy(buffer, caption, len - 2);
150-
buffer[len - 2] = '~';
148+
strncpy(buffer, caption, len - 1);
151149
buffer[len - 1] = '~';
152150
buffer[len] = 0;
153151
maDrawText(dx, dy, buffer);

0 commit comments

Comments
 (0)