mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #113527 from LanzaSchneider/fix-compilation-with-deprecated-disabled
Fix sprite_frames_editor_plugin compilation with deprecated=no
This commit is contained in:
commit
d1ce45488d
1 changed files with 6 additions and 3 deletions
|
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
#include "core/io/resource_loader.h"
|
#include "core/io/resource_loader.h"
|
||||||
#include "core/os/keyboard.h"
|
#include "core/os/keyboard.h"
|
||||||
|
#include "core/string/translation_server.h"
|
||||||
#include "editor/docks/filesystem_dock.h"
|
#include "editor/docks/filesystem_dock.h"
|
||||||
#include "editor/docks/scene_tree_dock.h"
|
#include "editor/docks/scene_tree_dock.h"
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
|
|
@ -316,13 +317,15 @@ void SpriteFramesEditor::_sheet_update_zoom_label() {
|
||||||
// (like in most image editors). Its lower bound is clamped to 1 as some people
|
// (like in most image editors). Its lower bound is clamped to 1 as some people
|
||||||
// lower the editor scale to increase the available real estate,
|
// lower the editor scale to increase the available real estate,
|
||||||
// even if their display doesn't have a particularly low DPI.
|
// even if their display doesn't have a particularly low DPI.
|
||||||
|
TranslationServer *translation_server = TranslationServer::get_singleton();
|
||||||
|
String locale = translation_server->get_tool_locale();
|
||||||
if (sheet_zoom >= 10) {
|
if (sheet_zoom >= 10) {
|
||||||
zoom_text = TS->format_number(rtos(Math::round((sheet_zoom / MAX(1, EDSCALE)) * 100)));
|
zoom_text = translation_server->format_number(rtos(Math::round((sheet_zoom / MAX(1, EDSCALE)) * 100)), locale);
|
||||||
} else {
|
} else {
|
||||||
// 2 decimal places if the zoom is below 10%, 1 decimal place if it's below 1000%.
|
// 2 decimal places if the zoom is below 10%, 1 decimal place if it's below 1000%.
|
||||||
zoom_text = TS->format_number(rtos(Math::snapped((sheet_zoom / MAX(1, EDSCALE)) * 100, (sheet_zoom >= 0.1) ? 0.1 : 0.01)));
|
zoom_text = translation_server->format_number(rtos(Math::snapped((sheet_zoom / MAX(1, EDSCALE)) * 100, (sheet_zoom >= 0.1) ? 0.1 : 0.01)), locale);
|
||||||
}
|
}
|
||||||
zoom_text += " " + TS->percent_sign();
|
zoom_text += " " + translation_server->get_percent_sign(locale);
|
||||||
split_sheet_zoom_reset->set_text(zoom_text);
|
split_sheet_zoom_reset->set_text(zoom_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue