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)