apps/webview: fix last character in line being cropped (fix #263) (#386)

the break position was calculated as

br = draw_w - draw_x + (left_gap / list.font_w);

adding left_gap/font_w was making br too large,
so lines were allowed to go past the drawable area
and the last character got clipped.

changed to:
br = draw_w - draw_x;
br /= list.font_w;

just the remaining pixels divided by char width,
no left_gap needed here

Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: #386
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: jaskaran-singh-77 <jassijatt951@gmail.com>
Co-committed-by: jaskaran-singh-77 <jassijatt951@gmail.com>
This commit was merged in pull request #386.
This commit is contained in:
2026-03-29 11:50:29 +00:00
committed by Burer
co-authored by Burer
parent b5981a39dc
commit f305d3425d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ void TWebBrowser::RenderTextbuf()
//Is a new line fits in the maximum line width?
if (br * list.font_w + draw_x - left_gap >= draw_w) {
br = draw_w - draw_x + left_gap /list.font_w;
br = draw_w - draw_x / list.font_w;
if (br < 0) br = 0;
while(br) {
if (ESBYTE[lbp + br]==' ') {
+1 -1
View File
@@ -113,4 +113,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
char version[]="WebView 3.93";
char version[]="WebView 3.94";