mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-15 23:37:59 +00:00
wip done
This commit is contained in:
@@ -151,6 +151,7 @@ const Health = ({
|
||||
const textContainer = textContainerRef.current;
|
||||
const resizeObserver = new ResizeObserver(() => {
|
||||
const calcFontSize = calculateFontSize(textContainer);
|
||||
console.log(calcFontSize);
|
||||
setFontSize(calcFontSize);
|
||||
});
|
||||
|
||||
@@ -180,9 +181,9 @@ const Health = ({
|
||||
|
||||
const minRatio = Math.min(widthRatio, heightRatio);
|
||||
|
||||
const heightIsLarger = heightRatio > widthRatio;
|
||||
const heightIs40PercentSmaller = heightRatio > widthRatio * 0.6;
|
||||
|
||||
const scaleFactor = heightIsLarger ? 0.8 : 1;
|
||||
const scaleFactor = heightIs40PercentSmaller ? 0.8 : 1;
|
||||
|
||||
return minRatio * scaleFactor * 1;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user