From 71bebc27f3659c8b4c38a2cc8cee825d34e4e3b9 Mon Sep 17 00:00:00 2001 From: cxxxr Date: Sun, 24 Nov 2024 18:20:25 +0900 Subject: [PATCH] fix #1631 `SDL Error Texture dimensions are limited` --- frontends/sdl2/display.lisp | 1 + frontends/sdl2/drawing.lisp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/frontends/sdl2/display.lisp b/frontends/sdl2/display.lisp index 5b2f2132b..d73da374b 100644 --- a/frontends/sdl2/display.lisp +++ b/frontends/sdl2/display.lisp @@ -35,6 +35,7 @@ :update-display :display-width :display-height + :display-window-width :adapt-high-dpi-font-size :change-font :with-renderer diff --git a/frontends/sdl2/drawing.lisp b/frontends/sdl2/drawing.lisp index de69e458e..ae5159e45 100644 --- a/frontends/sdl2/drawing.lisp +++ b/frontends/sdl2/drawing.lisp @@ -237,7 +237,14 @@ (defun redraw-physical-line (display view x y objects height) (loop :with current-x := x :for object :in objects - :do (incf current-x (draw-object object current-x (+ y height) display view)))) + :do (if (and (typep object 'text-object) + (< (display:display-window-width display) + (+ current-x (object-width object display)))) + (loop :for c :across (text-object-string object) + :do (let ((object (lem-core::make-letter-object c (text-object-attribute object)))) + (incf current-x (draw-object object current-x (+ y height) display view))) + :while (< current-x (display:display-window-width display))) + (incf current-x (draw-object object current-x (+ y height) display view))))) (defun redraw-physical-line-from-behind (display view objects) (loop :with current-x := (lem-if:view-width (lem-core:implementation) view)