feat: zoom possible, doit fix le scrollpane pour qu'il update ses scrollbars

This commit is contained in:
Emi Boucly 2025-03-17 14:36:49 +01:00
parent c47b49a616
commit b325204d7d
2 changed files with 59 additions and 2 deletions

View file

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.canvas.Canvas?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
@ -35,7 +37,35 @@
</MenuBar>
<SplitPane dividerPositions="0.11195652173913044" VBox.vgrow="ALWAYS">
<items>
<VBox prefHeight="200.0" prefWidth="100.0" />
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Zoom" />
<Slider fx:id="zoomSlider" blockIncrement="0.1" max="5.0" min="1.0" showTickLabels="true" showTickMarks="true" snapToTicks="true" value="1.0" GridPane.rowIndex="1" />
</children>
</GridPane>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Brush size" />
<Slider fx:id="brushSizeSlider" GridPane.rowIndex="1" />
</children>
</GridPane>
</children></VBox>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" />
@ -46,7 +76,7 @@
<RowConstraints vgrow="SOMETIMES" />
</rowConstraints>
<children>
<ScrollPane hbarPolicy="ALWAYS" style="-fx-background-color: #666666; -fx-background: #666666;" vbarPolicy="ALWAYS" GridPane.hgrow="ALWAYS" GridPane.vgrow="ALWAYS">
<ScrollPane fx:id="scrollPane" hbarPolicy="ALWAYS" style="-fx-background-color: #666666; -fx-background: #666666;" vbarPolicy="ALWAYS" GridPane.hgrow="ALWAYS" GridPane.vgrow="ALWAYS">
<content>
<Canvas fx:id="drawingCanvas" height="600.0" nodeOrientation="INHERIT" width="800.0" />
</content>