[TextServer] Pass Dictionary properties by value and check property values instead of references..
This commit is contained in:
parent
8449592d92
commit
1ced1f9c99
3 changed files with 18 additions and 10 deletions
|
@ -2383,8 +2383,10 @@ void TextServerAdvanced::_font_set_variation_coordinates(const RID &p_font_rid,
|
|||
ERR_FAIL_COND(!fd);
|
||||
|
||||
MutexLock lock(fd->mutex);
|
||||
_font_clear_cache(fd);
|
||||
fd->variation_coordinates = p_variation_coordinates;
|
||||
if (!fd->variation_coordinates.recursive_equal(p_variation_coordinates, 1)) {
|
||||
_font_clear_cache(fd);
|
||||
fd->variation_coordinates = p_variation_coordinates.duplicate();
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary TextServerAdvanced::_font_get_variation_coordinates(const RID &p_font_rid) const {
|
||||
|
|
|
@ -1376,8 +1376,10 @@ void TextServerFallback::_font_set_variation_coordinates(const RID &p_font_rid,
|
|||
ERR_FAIL_COND(!fd);
|
||||
|
||||
MutexLock lock(fd->mutex);
|
||||
_font_clear_cache(fd);
|
||||
fd->variation_coordinates = p_variation_coordinates;
|
||||
if (!fd->variation_coordinates.recursive_equal(p_variation_coordinates, 1)) {
|
||||
_font_clear_cache(fd);
|
||||
fd->variation_coordinates = p_variation_coordinates.duplicate();
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary TextServerFallback::_font_get_variation_coordinates(const RID &p_font_rid) const {
|
||||
|
|
|
@ -2833,12 +2833,14 @@ Ref<Font> FontVariation::_get_base_font_or_default() const {
|
|||
}
|
||||
|
||||
void FontVariation::set_variation_opentype(const Dictionary &p_coords) {
|
||||
variation.opentype = p_coords;
|
||||
_invalidate_rids();
|
||||
if (!variation.opentype.recursive_equal(p_coords, 1)) {
|
||||
variation.opentype = p_coords.duplicate();
|
||||
_invalidate_rids();
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary FontVariation::get_variation_opentype() const {
|
||||
return variation.opentype;
|
||||
return variation.opentype.duplicate();
|
||||
}
|
||||
|
||||
void FontVariation::set_variation_embolden(float p_strength) {
|
||||
|
@ -2875,12 +2877,14 @@ int FontVariation::get_variation_face_index() const {
|
|||
}
|
||||
|
||||
void FontVariation::set_opentype_features(const Dictionary &p_features) {
|
||||
opentype_features = p_features;
|
||||
_invalidate_rids();
|
||||
if (!opentype_features.recursive_equal(p_features, 1)) {
|
||||
opentype_features = p_features.duplicate();
|
||||
_invalidate_rids();
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary FontVariation::get_opentype_features() const {
|
||||
return opentype_features;
|
||||
return opentype_features.duplicate();
|
||||
}
|
||||
|
||||
void FontVariation::set_spacing(TextServer::SpacingType p_spacing, int p_value) {
|
||||
|
|
Loading…
Reference in a new issue