diff --git a/RP_L4/RPL4FE.cpp b/RP_L4/RPL4FE.cpp index 78beb10..23ce769 100644 --- a/RP_L4/RPL4FE.cpp +++ b/RP_L4/RPL4FE.cpp @@ -641,11 +641,6 @@ namespace if (row_h < 18) row_h = 18; if (row_h > 30) row_h = 30; - int col_w = client_w / 5; - int col1 = client_w / 14; - int col2 = col1 + col_w + client_w / 28; - int col3 = col2 + col_w + client_w / 28; - int col4 = col3 + col_w + client_w / 28; int top = client_h / 7; //--------------------------------------------------------------- @@ -665,6 +660,31 @@ namespace int vehicle_split = wrap_vehicles ? (vehicle_count + 1) / 2 // balanced, not filled-then-spilled : vehicle_count; + + //--------------------------------------------------------------- + // Three columns can afford generous margins; four cannot. Keeping + // the three-column fractions for a fourth column left the last one + // hard against the frame - 19px of slack at 800x600, with the + // longest vehicle name needing all but 2px of its column. So the + // wrapped layout spreads its four columns evenly instead, and the + // unwrapped one keeps the proportions it always had. + //--------------------------------------------------------------- + int col_w, col1, gap; + if (wrap_vehicles) + { + col1 = client_w / 20; + gap = client_w / 50; + col_w = (client_w - 2 * col1 - 3 * gap) / 4; + } + else + { + col1 = client_w / 14; + gap = client_w / 28; + col_w = client_w / 5; + } + int col2 = col1 + col_w + gap; + int col3 = col2 + col_w + gap; + int col4 = col3 + col_w + gap; int loadout_col = wrap_vehicles ? col4 : col3; int y = top; @@ -905,8 +925,11 @@ namespace } RECT text = row; text.left += 6; + // On a narrow window the longest names (Screaming Broccoli, + // Blacker Tarantula) outrun their column. Ellipsis rather than + // a glyph sliced down the middle. DrawTextA(mem, ItemName(item->group, item->index), -1, &text, - DT_LEFT | DT_VCENTER | DT_SINGLELINE); + DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS); } // pilot-name header