-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: the gen-ai reframe panel shows out of the viewport if generated …
…topics make the selected topic out of the viewport.
- Loading branch information
Showing
3 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
code/mindolph-base/src/test/java/com/mindolph/base/util/LayoutUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.mindolph.base.util; | ||
|
||
import com.mindolph.mfx.util.PointUtils; | ||
import javafx.geometry.BoundingBox; | ||
import javafx.geometry.Bounds; | ||
import javafx.geometry.Dimension2D; | ||
import javafx.geometry.Point2D; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* @since 1.7.6 | ||
*/ | ||
public class LayoutUtilsTest { | ||
|
||
static Bounds baseParentBounds; | ||
static Bounds baseHoverBounds; | ||
|
||
@BeforeAll | ||
public static void setup() { | ||
baseParentBounds = new BoundingBox(0, 0, 1000, 1000); | ||
baseHoverBounds = new BoundingBox(0, 0, 1000, 1000); | ||
} | ||
|
||
@Test | ||
public void bestLocation() { | ||
|
||
Dimension2D dim = new Dimension2D(100, 100); | ||
|
||
Bounds hb = new BoundingBox(0, 0, 100, 100); | ||
Point2D point2D = LayoutUtils.bestLocation(baseParentBounds, hb, dim, null); | ||
System.out.println(PointUtils.pointInStr(point2D)); | ||
|
||
hb = new BoundingBox(950, 950, 100, 100); | ||
point2D = LayoutUtils.bestLocation(baseParentBounds, hb, dim, null); | ||
System.out.println(PointUtils.pointInStr(point2D)); | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters