aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-09-28 14:50:07 +0200
committerGitHub <noreply@github.com>2022-09-28 08:50:07 -0400
commitc3066f549c38aeb1f187fd3f81c335faca4d08bf (patch)
treec0555d9db6610779c81c862bf51325d5a1434fc3 /src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java
parent158dfe128df8d95971b7d0db2bd5dfaf700818b3 (diff)
downloadOneConfig-c3066f549c38aeb1f187fd3f81c335faca4d08bf.tar.gz
OneConfig-c3066f549c38aeb1f187fd3f81c335faca4d08bf.tar.bz2
OneConfig-c3066f549c38aeb1f187fd3f81c335faca4d08bf.zip
new: small gui changes (#132)
* remove background from HUD and close buttons * Gui improvements (#126) * Fix drop shadow * Add credit to the best team member in polyfrost :> * Removed some unused buttons & improved line spacing * new logo * new arrows * Added new animations & tweaked timings * Update new page animation, and sidebar animations * Update EaseOutBump.java * apiDump Co-authored-by: Wyvest <45589059+Wyvest@users.noreply.github.com> Co-authored-by: CaledonianEH <62163840+CaledonianEH@users.noreply.github.com>
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java45
1 files changed, 10 insertions, 35 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java b/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java
index 4d54621..2e78e6f 100644
--- a/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java
+++ b/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java
@@ -621,10 +621,6 @@ public final class RenderManager {
public static void drawSvg(long vg, String filePath, float x, float y, float width, float height, float scale) {
float w = width * scale;
float h = height * scale;
- if (OneConfigGui.INSTANCE != null && OneConfigGui.isOpen()) {
- w *= OneConfigGui.INSTANCE.getScaleFactor();
- h *= OneConfigGui.INSTANCE.getScaleFactor();
- }
if (AssetLoader.INSTANCE.loadSVG(vg, filePath, w, h)) {
NVGPaint imagePaint = NVGPaint.calloc();
int image = AssetLoader.INSTANCE.getSVG(filePath, w, h);
@@ -648,11 +644,8 @@ public final class RenderManager {
* @param height The height.
*/
public static void drawSvg(long vg, String filePath, float x, float y, float width, float height) {
- float scale = 1;
- if (OneConfigGui.isOpen()) {
- scale = OneConfigGui.getScaleFactor();
- }
- drawSvg(vg, filePath, x, y, width, height, scale);
+ if (OneConfigGui.isOpen()) drawSvg(vg, filePath, x, y, width, height, OneConfigGui.getScaleFactor());
+ else drawSvg(vg, filePath, x, y, width, height, 1f);
}
/**
@@ -695,11 +688,8 @@ public final class RenderManager {
* @param color The color.
*/
public static void drawSvg(long vg, String filePath, float x, float y, float width, float height, int color) {
- float scale = 1;
- if (OneConfigGui.isOpen()) {
- scale = OneConfigGui.getScaleFactor();
- }
- drawSvg(vg, filePath, x, y, width, height, color, scale);
+ if (OneConfigGui.isOpen()) drawSvg(vg, filePath, x, y, width, height, color, OneConfigGui.getScaleFactor());
+ else drawSvg(vg, filePath, x, y, width, height, color, 1f);
}
/**
@@ -708,11 +698,7 @@ public final class RenderManager {
* @see RenderManager#drawSvg(long, String, float, float, float, float)
*/
public static void drawSvg(long vg, SVG svg, float x, float y, float width, float height, float scale) {
- float w = width * scale;
- float h = height * scale;
- if (AssetLoader.INSTANCE.loadSVG(vg, svg, w, h)) {
- drawSvg(vg, svg.filePath, x, y, width, height);
- }
+ drawSvg(vg, svg.filePath, x, y, width, height, scale);
}
/**
@@ -721,11 +707,7 @@ public final class RenderManager {
* @see RenderManager#drawSvg(long, String, float, float, float, float)
*/
public static void drawSvg(long vg, SVG svg, float x, float y, float width, float height) {
- float scale = 1;
- if (OneConfigGui.isOpen()) {
- scale = OneConfigGui.getScaleFactor();
- }
- drawSvg(vg, svg, x, y, width, height, scale);
+ drawSvg(vg, svg.filePath, x, y, width, height);
}
/**
@@ -734,11 +716,7 @@ public final class RenderManager {
* @see RenderManager#drawSvg(long, String, float, float, float, float, int)
*/
public static void drawSvg(long vg, SVG svg, float x, float y, float width, float height, int color, float scale) {
- float w = width * scale;
- float h = height * scale;
- if (AssetLoader.INSTANCE.loadSVG(vg, svg, w, h)) {
- drawSvg(vg, svg.filePath, x, y, width, height, color);
- }
+ drawSvg(vg, svg.filePath, x, y, width, height, color, scale);
}
/**
@@ -747,15 +725,12 @@ public final class RenderManager {
* @see RenderManager#drawSvg(long, String, float, float, float, float)
*/
public static void drawSvg(long vg, SVG svg, float x, float y, float width, float height, int color) {
- float scale = 1;
- if (OneConfigGui.isOpen()) {
- scale = OneConfigGui.getScaleFactor();
- }
- drawSvg(vg, svg, x, y, width, height, color, scale);
+ if (OneConfigGui.isOpen()) drawSvg(vg, svg, x, y, width, height, color, OneConfigGui.getScaleFactor());
+ else drawSvg(vg, svg, x, y, width, height, color, 1f);
}
/**
- * Draw a circle with an info icon inside of it
+ * Draw a circle with an info icon inside it
*
* @param vg The NanoVG context.
* @param type The icon type.