[Draw Text] Fix font sharing AA property.

This commit is contained in:
Tanasart 2024-09-05 08:50:28 +07:00
parent 9259b43b28
commit c457dc0dd9
4 changed files with 16 additions and 17 deletions

View file

@ -39,7 +39,7 @@
LATEST_VERSION = 1_16_00; LATEST_VERSION = 1_16_00;
VERSION = 1_17_11_0; VERSION = 1_17_11_0;
SAVE_VERSION = 1_17_10_0; SAVE_VERSION = 1_17_10_0;
VERSION_STRING = "1.17.12.002"; VERSION_STRING = "1.17.12.004";
BUILD_NUMBER = 1_17_11_0; BUILD_NUMBER = 1_17_11_0;
HOTKEYS = ds_map_create(); HOTKEYS = ds_map_create();

View file

@ -341,8 +341,9 @@ function shader_set_gradient(gradient, surface, range, junc) {
} }
function evaluate_gradient_map(_x, gradient, surface, range, junc, fast = false) { function evaluate_gradient_map(_x, gradient, surface, range, junc, fast = false) {
var use_map = junc.attributes.mapped; if(!is_surface(surface)) return 0;
var use_map = junc.attributes.mapped;
if(!use_map) return fast? gradient.evalFast(_x) : gradient.eval(_x); if(!use_map) return fast? gradient.evalFast(_x) : gradient.eval(_x);
var _sw = surface_get_width(surface); var _sw = surface_get_width(surface);

View file

@ -82,12 +82,9 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_aa_current = false; _aa_current = false;
seed = seed_random(); seed = seed_random();
static generateFont = function(_path, _size, _aa) { #region static generateFont = function(_path, _size, _aa) {
if(PROJECT.animator.is_playing) return; if(PROJECT.animator.is_playing) return;
if( font_exists(font) && if(font_exists(font) && _path == _font_current && _size == _size_current && _aa == _aa_current) return;
_path == _font_current &&
_size == _size_current &&
_aa == _aa_current) return;
_font_current = _path; _font_current = _path;
_size_current = _size; _size_current = _size;
@ -99,10 +96,10 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
font_delete(font); font_delete(font);
font_add_enable_aa(_aa); font_add_enable_aa(_aa);
font = _font_add(_path, _size,, true); font = font_add(_path, _size, false, false, 0, 127);
} #endregion }
static step = function() { #region static step = function() {
var _font = getSingleValue(1); var _font = getSingleValue(1);
var _dimt = getSingleValue(9); var _dimt = getSingleValue(9);
var _path = getSingleValue(13); var _path = getSingleValue(13);
@ -120,9 +117,9 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
inputs[ 3].setVisible(_font != ""); inputs[ 3].setVisible(_font != "");
inputs[11].setVisible(_font != ""); inputs[11].setVisible(_font != "");
inputs[12].setVisible(_font != ""); inputs[12].setVisible(_font != "");
} #endregion }
static waveGet = function(_ind) { #region static waveGet = function(_ind) {
var _x = __wave_phase + _ind * __wave_scale; var _x = __wave_phase + _ind * __wave_scale;
var _sine = dsin(_x) * __wave_ampli; var _sine = dsin(_x) * __wave_ampli;
@ -140,7 +137,7 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
else if(__wave_shape < 3) return abs(_x) % 360 > 360 * (0.5 - frac(__wave_shape) / 2)? -__wave_ampli : __wave_ampli; else if(__wave_shape < 3) return abs(_x) % 360 > 360 * (0.5 - frac(__wave_shape) / 2)? -__wave_ampli : __wave_ampli;
return random_range_seed(-1, 1, _x + seed) * __wave_ampli; return random_range_seed(-1, 1, _x + seed) * __wave_ampli;
} #endregion }
static processData = function(_outSurf, _data, _output_index, _array_index) { static processData = function(_outSurf, _data, _output_index, _array_index) {
var str = _data[0], strRaw = str; var str = _data[0], strRaw = str;

View file

@ -1333,6 +1333,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
if(mouse_press(mb_right, _focus)) { // if(mouse_press(mb_right, _focus)) { //
node_hover = node_hovering; node_hover = node_hovering;
__junction_hovering = noone;
if(value_focus) { if(value_focus) {
// print($"Right click value focus {value_focus}"); // print($"Right click value focus {value_focus}");