Skip to content

Commit

Permalink
Fix label font size on large grids
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriSanchez1 committed Nov 16, 2023
1 parent e2a1c32 commit 4d0308d
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/components/Settings/Export/Export.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import {
PDF_GRID_WIDTH,
PDF_BORDER_WIDTH,
PICSEEPAL_IMAGES_WIDTH,
PDF_IMAGES_WIDTH
PDF_IMAGES_WIDTH,
SMALL_FONT_SIZE,
MEDIUM_FONT_SIZE
} from './Export.constants';
import {
LABEL_POSITION_ABOVE,
Expand Down Expand Up @@ -640,12 +642,19 @@ const addTileToGrid = async (

imageData.width = Math.min(IMG_WIDTH.column[columns], IMG_WIDTH.row[rows]);

if (labelFontSize <= 9) {
imageData.width = 45;
} else if (labelFontSize <= 12) {
imageData.width = 40;
} else if (labelFontSize <= 16) {
imageData.width = 37;
if (imageData.width <= 45) {
if (imageData.width <= 37) {
labelData.fontSize = 7;
} else if (imageData.width <= 40) {
labelData.fontSize = 8;
} else if (imageData.width <= 45) {
labelData.fontSize = 9;
}

if (labelFontSize === SMALL_FONT_SIZE)
labelData.fontSize = labelData.fontSize - 2;
if (labelFontSize === MEDIUM_FONT_SIZE)
labelData.fontSize = labelData.fontSize + 2;
}

let value1,
Expand Down

0 comments on commit 4d0308d

Please sign in to comment.