Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GeoVistoogsi
AR
Commits
c6d108b9
Commit
c6d108b9
authored
2 months ago
by
Percen
Browse files
Options
Download
Email Patches
Plain Diff
Update public/index.html
parent
a161b1d0
master
21caog1bif-master-patch-96693
1 merge request
!162
Update public/index.html
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.html
+7
-5
public/index.html
with
7 additions
and
5 deletions
+7
-5
public/index.html
+
7
-
5
View file @
c6d108b9
...
...
@@ -582,24 +582,25 @@ function calculateMaxScale(object) {
const
viewportWidth
=
window
.
innerWidth
;
const
viewportHeight
=
window
.
innerHeight
;
// Berechne d
as Verhältnis zwischen der Größe des Viewports und der Größe des Objekts
// Berechne d
ie maximal mögliche Skalierung, um im Viewport zu bleiben
const
scaleWidth
=
viewportWidth
/
boundingBox
.
x
;
const
scaleHeight
=
viewportHeight
/
boundingBox
.
y
;
//
Reduziere den Wer
t, um sicherzu
stell
en, dass das Objekt nicht
zu groß wird
const
safeScaleFactor
=
0.9
;
//
Reduziert die Skalierung um 10%, um s
ich
er
zu
sein
//
Wähle den kleineren Wert und reduziere ihn leich
t, um sicherzu
geh
en, dass das Objekt nicht
über den Rand hinausgeht
const
safeScaleFactor
=
0.9
5
;
//
Puffer, um sicherzustellen, dass es n
ich
t
zu
groß wird
return
Math
.
min
(
scaleWidth
,
scaleHeight
)
*
safeScaleFactor
;
}
function
openScaleMenu
()
{
if
(
!
selectedPlacedModel
)
{
showInfoDialog
(
"
Kein Modell ausgewählt. Bitte wählen Sie ein Modell aus, bevor Sie es bearbeiten.
"
);
return
;
}
// Berechne die maximale Skalierung
// Berechne die maximale Skalierung
für das spezifische Objekt
const
maxScale
=
calculateMaxScale
(
selectedPlacedModel
);
// Aktuelle Skalierung des Modells bestimmen
...
...
@@ -609,11 +610,12 @@ function openScaleMenu() {
dynamicMenu
.
style
.
display
=
"
flex
"
;
dynamicMenu
.
innerHTML
=
`
<h3>Skalierung anpassen</h3>
<label>Größe: <span id="scale-value">
${
currentScale
.
toFixed
(
2
)}
</span><input type="range" min="0.01" max="
${
maxScale
}
" step="0.001" value="
${
currentScale
}
" onchange="updateScale(this.value)"></label>
<label>Größe: <span id="scale-value">
${
currentScale
.
toFixed
(
2
)}
</span><input type="range" min="0.01" max="
${
maxScale
.
toFixed
(
2
)
}
" step="0.
0
001" value="
${
currentScale
}
" onchange="updateScale(this.value)"></label>
<button onclick="closeDynamicMenu()">Zurück</button>
`
;
}
/**
*
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets