Skip to content

Commit 86181fd

Browse files
committed
PB-1522 : fix confederation text shrinking/covered in print view
When using a narrow layout (such as A4 portrait) the confederation text was switching to the "mobile" layout, and using a width that match only the flag.
1 parent da0d13e commit 86181fd

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

packages/mapviewer/src/modules/menu/components/header/ConfederationFullLogo.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const hasDevSiteWarning = computed(() => store.getters.hasDevSiteWarning)
3636
data-cy="swiss-flag"
3737
/>
3838
<div
39-
class="swiss-confederation-text position-relative flex-column text-nowrap"
39+
class="swiss-confederation-text position-relative flex-column flex-grow-1"
4040
:class="{
4141
'd-none d-lg-flex': renderForDpi === null,
4242
'd-flex': renderForDpi !== null,
@@ -80,6 +80,7 @@ $letterSpacing: calc((78 / 1000) * 1em);
8080
8181
.swiss-flag {
8282
width: $flagSize;
83+
height: max-content;
8384
}
8485
8586
.swiss-confederation-text {
@@ -114,14 +115,16 @@ $letterSpacing: calc((78 / 1000) * 1em);
114115
$printFontSizeRelToHeight: 0.8vh;
115116
$printFontSize: max(max($printFontSizeRelToWidth, $printFontSizeRelToHeight), $minFontSize);
116117
117-
// forcing the length of the logo to the 55mm expressed in the CD-Bund PDF guide.
118-
width: 55mm;
119-
120118
@include confederation-logo(
121119
calc(0.66 * $printFontSize),
122120
$printFontSize,
123121
calc(1.2 * $printFontSize)
124122
);
123+
124+
& {
125+
// ensuring the logo and text have enough space
126+
width: 100%;
127+
}
125128
}
126129
127130
.swiss-flag {

packages/mapviewer/src/views/PrintView.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async function generateShareLink() {
143143
:style="printContainerStyle"
144144
>
145145
<MapModule class="flex-grow-1">
146-
<div class="north-arrow position-absolute top-0 end-0 m-4 m-xl-5 z-3">
146+
<div class="north-arrow position-absolute m-xl-5 z-3 end-0 top-0 m-4">
147147
<img
148148
src="@/modules/map/assets/north_arrow.png"
149149
:style="northArrowStyle"
@@ -156,7 +156,7 @@ async function generateShareLink() {
156156
<template #top-right>
157157
<div
158158
v-if="shortLink"
159-
class="print-scale-line d-flex flex-column m-2 me-3 me-xl-3 bg-white p-3 border border-2 border-black"
159+
class="print-scale-line d-flex flex-column me-xl-3 m-2 me-3 border border-2 border-black bg-white p-3"
160160
>
161161
<div class="scale d-flex justify-content-center m-1 mb-3">
162162
<OpenLayersScale
@@ -192,7 +192,7 @@ async function generateShareLink() {
192192
<img
193193
v-if="shortLink"
194194
:src="qrCodeUrl"
195-
class="qr-code position-relative bottom-0 end-0 z-3 bg-white p-2 m-n1"
195+
class="qr-code position-relative z-3 m-n1 bottom-0 end-0 bg-white p-2"
196196
alt="QR Code"
197197
/>
198198
</template>
@@ -202,9 +202,9 @@ async function generateShareLink() {
202202
</MapFooter>
203203
</template>
204204
</MapModule>
205-
<div class="print-footer d-flex pt-3 px-3 pb-1 gap-3">
205+
<div class="print-footer d-flex gap-3 p-1">
206206
<ConfederationFullLogo :render-for-dpi="printDPI" />
207-
<div class="print-disclaimer flew-grow-1 px-1 px-md-3 px-xl-5 d-flex flex-column">
207+
<div class="print-disclaimer flex-grow-1 px-md-3 px-xl-5 d-flex flex-column px-1">
208208
<span class="text-justify">{{ t('print_footer_description') }}</span>
209209
<span class="text-justify">{{ t('print_footer_disclaimer') }}</span>
210210
<span class="mt-1">&copy; swisstopo</span>

0 commit comments

Comments
 (0)