From f59d081804a42d64faf9cb3292e43545eacf8be0 Mon Sep 17 00:00:00 2001 From: NeeEoo Date: Sat, 12 Aug 2023 13:47:33 +0200 Subject: [PATCH] Fix bug with shader --- assets/shaders/engine/editorBlurFast.frag | 4 ++-- .../funkin/editors/charter/CharterStrumlineExtraButton.hx | 7 +++++++ source/funkin/editors/ui/UIDropDown.hx | 3 ++- source/funkin/editors/ui/UIScrollBar.hx | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/shaders/engine/editorBlurFast.frag b/assets/shaders/engine/editorBlurFast.frag index 8abad7aa..74317dfc 100644 --- a/assets/shaders/engine/editorBlurFast.frag +++ b/assets/shaders/engine/editorBlurFast.frag @@ -10,7 +10,7 @@ float uBlur = 0.015; float uBrightness = 0.6; vec4 getColor(vec2 pos) { - vec2 ps = camToOg(pos); + vec2 ps = (pos); if (ps.x < 0) ps.x = 0; //else if (ps.x > 1.0 - (1.0 / iResolution.x)) ps.x = 1.0 - (1.0 / iResolution.x); else if (ps.x > 1.0) return vec4(0.0); @@ -40,7 +40,7 @@ vec2 random(vec2 p) { } void main() { - vec2 camPos = getCamPos(openfl_TextureCoordv); + vec2 camPos = (openfl_TextureCoordv); //vec2 camPos = openfl_TextureCoordv; if (camPos.x < 0 || camPos.x > 1 || camPos.y < 0 || camPos.y > 1) return; diff --git a/source/funkin/editors/charter/CharterStrumlineExtraButton.hx b/source/funkin/editors/charter/CharterStrumlineExtraButton.hx index 4aa9fe89..f19e4c30 100644 --- a/source/funkin/editors/charter/CharterStrumlineExtraButton.hx +++ b/source/funkin/editors/charter/CharterStrumlineExtraButton.hx @@ -19,6 +19,7 @@ class CharterStrumlineExtraButton extends UISprite { button.scale.set(0.75,0.75); button.updateHitbox(); button.antialiasing = false; + button.cursor = BUTTON; members.push(button); this.text = new UIText(0,0, 160, text); @@ -49,4 +50,10 @@ class CharterStrumlineExtraButton extends UISprite { FlxMath.lerp(button.scale.y, buttonScale.y, 1/6) ); } + + public override function destroy() { + super.destroy(); + + buttonScale.put(); + } } \ No newline at end of file diff --git a/source/funkin/editors/ui/UIDropDown.hx b/source/funkin/editors/ui/UIDropDown.hx index 22cb7274..b5d8982d 100644 --- a/source/funkin/editors/ui/UIDropDown.hx +++ b/source/funkin/editors/ui/UIDropDown.hx @@ -17,6 +17,8 @@ class UIDropDown extends UISliceSprite { this.options = options; this.index = index; + cursor = BUTTON; + label = new UIText(0, 0, width - height, options[index]); members.push(label); @@ -33,7 +35,6 @@ class UIDropDown extends UISliceSprite { } public override function update(elapsed:Float) { - var opened = curMenu.contextMenuOpened(); framesOffset = (opened || (hovered && FlxG.mouse.pressed)) ? 18 : (hovered ? 9 : 0); if (FlxG.mouse.justReleased && (hovered || dropButton.hovered)) { diff --git a/source/funkin/editors/ui/UIScrollBar.hx b/source/funkin/editors/ui/UIScrollBar.hx index 171846d7..c6ef73d2 100644 --- a/source/funkin/editors/ui/UIScrollBar.hx +++ b/source/funkin/editors/ui/UIScrollBar.hx @@ -24,6 +24,7 @@ class UIScrollBar extends UISprite { this.length = length; thumb = new UISliceSprite(0, 0, w, h, 'editors/ui/scrollbar'); + thumb.cursor = BUTTON; members.push(thumb); thumbIcon = new FlxSprite(0, 0, Paths.image('editors/ui/scrollbar-icon'));