Skip to content

Commit

Permalink
Usuniecie bugow
Browse files Browse the repository at this point in the history
  • Loading branch information
przemo8155 committed Jan 14, 2018
1 parent 3473a5b commit 12f01a7
Showing 1 changed file with 35 additions and 34 deletions.
69 changes: 35 additions & 34 deletions src/application/MainWindowController.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public class MainWindowController
double orgTranslateX, orgTranslateY;
static int minusWidth = 95;
protected int startingFaze = 0;
final double SCALE_DELTA = 1.1;

public static String optPath = "";
public static String checkFileRecognition = "";
Expand Down Expand Up @@ -3189,7 +3190,6 @@ void mainPane_OnMouseDragged(MouseEvent event)
{
case "move":
hideInformationTooltip();
movingMainPane();
int _it = 0;
while (_it < utilities.takeMaximumFromLists(circleList, rectangleList, headArrowList,
leftDoubleArrowList, rightDoubleArrowList, existingImageViews, tokensBiggerThanTen, tags,
Expand Down Expand Up @@ -3245,43 +3245,13 @@ public void initialize()
mainWindowControllerReadSetting();
setPaneResolution();

mainPane.setFocusTraversable(true);
setBackgroundColor();
setTooltips();
initializeStats();

movingMainPane();








mainPane.setOnScroll(new EventHandler<ScrollEvent>()
{

@Override
public void handle(ScrollEvent event)
{
double zoomFactor = 1.02;
double deltaY = event.getDeltaY();

if (deltaY < 0){
zoomFactor = 0.98;
}
mainPane.setScaleX(mainPane.getScaleX() * zoomFactor);
mainPane.setScaleY(mainPane.getScaleY() * zoomFactor);



event.consume();

}

});

middleLabel.setDisable(true);

mainPane_AddEventHandlerClick();
Expand Down Expand Up @@ -4483,16 +4453,16 @@ private void setTooltips()

void setPaneResolution()
{
/*Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
mainPane.setMaxWidth(primaryScreenBounds.getWidth());
mainPane.setMaxHeight(primaryScreenBounds.getHeight());
mainPane.setMinWidth(primaryScreenBounds.getWidth());
mainPane.setMinHeight(primaryScreenBounds.getHeight());
*/
/*
mainPane.setMaxWidth(PANE_WIDTH);
mainPane.setMaxHeight(PANE_HEIGHT);
mainPane.setMinWidth(PANE_WIDTH);
mainPane.setMinHeight(PANE_HEIGHT);
mainPane.setMinHeight(PANE_HEIGHT);*/

}

Expand Down Expand Up @@ -5674,6 +5644,37 @@ void startAnimationButton_OnMouseClicked(MouseEvent event)
hideInformationTooltip();
}

void zoomingMainPane()
{



mainPane.setOnScroll(new EventHandler<ScrollEvent>()
{

@Override
public void handle(ScrollEvent event)
{
event.consume();

if (event.getDeltaY() == 0) {
return;
}

double scaleFactor =
(event.getDeltaY() > 0)
? SCALE_DELTA
: 1/SCALE_DELTA;

mainPane.setScaleX(mainPane.getScaleX() * scaleFactor);
mainPane.setScaleY(mainPane.getScaleY() * scaleFactor);


}

});
}

void movingMainPane()
{
mainPane.setFocusTraversable(true);
Expand Down

0 comments on commit 12f01a7

Please sign in to comment.