mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[godot] Closes #2516, memdelete instead of memfree on Control
This commit is contained in:
parent
77f48a39db
commit
5a462e9e21
1
spine-godot/build/debug.plist
Normal file
1
spine-godot/build/debug.plist
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.get-task-allow</key><true/></dict></plist>
|
||||||
2
spine-godot/build/sign.sh
Executable file
2
spine-godot/build/sign.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
codesign -s - -v -f --entitlements build/debug.plist godot/bin/godot.macos.editor.dev.arm64
|
||||||
@ -33,6 +33,7 @@
|
|||||||
#include "SpineSkeleton.h"
|
#include "SpineSkeleton.h"
|
||||||
#include "SpineRendererObject.h"
|
#include "SpineRendererObject.h"
|
||||||
#include "SpineSlotNode.h"
|
#include "SpineSlotNode.h"
|
||||||
|
#include "core/os/memory.h"
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/config/engine.h"
|
#include "core/config/engine.h"
|
||||||
@ -1047,14 +1048,6 @@ void SpineSprite::draw() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if TOOLS_ENABLED
|
#if TOOLS_ENABLED
|
||||||
Ref<Font> default_font;
|
|
||||||
auto control = memnew(Control);
|
|
||||||
#if VERSION_MAJOR > 3
|
|
||||||
default_font = control->get_theme_default_font();
|
|
||||||
#else
|
|
||||||
default_font = control->get_font(SNAME("font"), SNAME("Label"));
|
|
||||||
#endif
|
|
||||||
memfree(control);
|
|
||||||
|
|
||||||
float editor_scale = EditorInterface::get_singleton()->get_editor_scale();
|
float editor_scale = EditorInterface::get_singleton()->get_editor_scale();
|
||||||
float inverse_zoom = 1 / get_viewport()->get_global_canvas_transform().get_scale().x * editor_scale;
|
float inverse_zoom = 1 / get_viewport()->get_global_canvas_transform().get_scale().x * editor_scale;
|
||||||
@ -1074,6 +1067,15 @@ void SpineSprite::draw() {
|
|||||||
auto global_scale = get_global_scale();
|
auto global_scale = get_global_scale();
|
||||||
draw_set_transform(mouse_position + Vector2(20, 0), -get_global_rotation(), Vector2(inverse_zoom * (1 / global_scale.x), inverse_zoom * (1 / global_scale.y)));
|
draw_set_transform(mouse_position + Vector2(20, 0), -get_global_rotation(), Vector2(inverse_zoom * (1 / global_scale.x), inverse_zoom * (1 / global_scale.y)));
|
||||||
|
|
||||||
|
Ref<Font> default_font;
|
||||||
|
auto control = memnew(Control);
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
|
default_font = control->get_theme_default_font();
|
||||||
|
#else
|
||||||
|
default_font = control->get_font(SNAME("font"), SNAME("Label"));
|
||||||
|
#endif
|
||||||
|
memdelete(control);
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
float line_height = default_font->get_height(Font::DEFAULT_FONT_SIZE) + default_font->get_descent(Font::DEFAULT_FONT_SIZE);
|
float line_height = default_font->get_height(Font::DEFAULT_FONT_SIZE) + default_font->get_descent(Font::DEFAULT_FONT_SIZE);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user