Lagrange [work/v1.12]

GmDocument: Justified margins

=> 0fe60c4a6051af40405f478a4d80015839e8be9b

diff --git a/src/gmdocument.c b/src/gmdocument.c
index 77d6af7e..0e07556e 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -684,6 +684,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
     uint16_t         preId         = 0;
     iBool            enableIndents = iFalse;
     const iBool      isNormalized  = isNormalized_GmDocument_(d);
+    const iBool      isJustified   = prefs->justifyParagraph;
     enum iGmLineType prevType      = text_GmLineType;
     enum iGmLineType prevNonBlankType = text_GmLineType;
     iBool            followsBlank  = iFalse;
@@ -967,14 +968,17 @@ static void doLayout_GmDocument_(iGmDocument *d) {
             rts.isPreformat   = isPreformat;
             rts.layoutWidth   = d->size.x;
             rts.indent        = indent * gap_Text;
+            const iBool isTextType =
+                (type == text_GmLineType || type == bullet_GmLineType || type == quote_GmLineType);
             /* The right margin is used for balancing lines horizontally. */
             if (isVeryNarrow || isFullWidthImages) {
-                rts.rightMargin = 0;
+                rts.rightMargin = (!isExtremelyNarrow && isJustified && isTextType ? 4 : 0) * gap_Text;
+                if (!isExtremelyNarrow && isJustified && type == link_GmLineType) {
+                    rts.rightMargin = gap_Text;
+                }
             }
             else {
-                rts.rightMargin = (type == text_GmLineType || type == bullet_GmLineType ||
-                                           type == quote_GmLineType
-                                       ? 4 : 0) * gap_Text;
+                rts.rightMargin = (isTextType ? 4 : 0) * gap_Text;
             }
             if (!isMono) {
 #if 0
@@ -1726,7 +1730,8 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *paletteSeed, const iB
                 if (altIndex == 2) {
 //                    altBase.sat = 0.5f;
                     altBase.sat *= 0.8f;
-                    altBase.hue -= 10;
+                    altBase.lum += 0.1f;
+                    altBase.hue -= 40;
                 }
             }
             setHsl_Color(tmBackground_ColorId, base);
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.12/cdiff/0fe60c4a6051af40405f478a4d80015839e8be9b
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
69.930262 milliseconds
Gemini-to-HTML Time
0.222481 milliseconds

This content has been proxied by September (3851b).