Skip to content

Commit 3ea1b8b

Browse files
committed
1.22
1 parent 6876371 commit 3ea1b8b

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
group 'dev.felnull'
88
archivesBaseName = "felnull-java-library"
9-
version '1.21'
9+
version '1.22'
1010

1111
repositories {
1212
mavenCentral()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.felnull.fnjl;
22

33
public class BuildIn {
4-
protected static final String VERSION = "1.21";
4+
protected static final String VERSION = "1.22";
55

66
protected static final int NATIVE_LIB_VERSION = 2;
77
}

src/main/java/dev/felnull/fnjl/util/FNMath.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dev.felnull.fnjl.util;
22

33
import dev.felnull.fnjl.math.FNComplex;
4+
import dev.felnull.fnjl.math.FNVec2d;
45
import dev.felnull.fnjl.math.FNVec2i;
56

67
import java.util.function.Consumer;
@@ -211,6 +212,15 @@ public static void generateColorMandelbrot(int width, int height, double posX, d
211212
}
212213
}
213214

215+
public static FNVec2d scale(double w, double h) {
216+
if (w > h) {
217+
return new FNVec2d(1, h / w);
218+
} else {
219+
return new FNVec2d(w / h, 1);
220+
}
221+
}
222+
223+
214224
public static class PosColorEntry {
215225
private final FNVec2i pos;
216226
private final int color;

src/test/java/dev/felnull/TestMain.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package dev.felnull;
22

3+
import dev.felnull.fnjl.util.FNMath;
4+
35
public class TestMain {
46
public static void main(String[] args) throws Exception {
7+
System.out.println(FNMath.scale(512, 1024));
58
/* long time = System.currentTimeMillis();
69
FNRuntimeUtil.multipleRun("Ikisugi", 2, () -> {
710
try {

0 commit comments

Comments
 (0)