Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Orientation parameter display on Text Tool Options Panel #2372

Merged
merged 5 commits into from Nov 2, 2021

Conversation

rodolforg
Copy link
Contributor

The problem was the LC_NUMERIC locale was changed for loading preferences and the value was set on widget before changing back to proper locale.

This PR reduces the duration of the temporary locale change.

@lgtm-com
Copy link

lgtm-com bot commented Oct 18, 2021

This pull request introduces 4 alerts when merging 3c65d63 into 19a88f4 - view on LGTM.com

new alerts:

  • 3 for Catching by value
  • 1 for Constant return type

@rodolforg
Copy link
Contributor Author

Last push fixed the LGTM above :)

@@ -446,7 +446,7 @@ class SetsModel : public Gtk::TreeModel::ColumnRecord
class Preferences : public synfigapp::Settings
{
public:
virtual bool get_value(const synfig::String& key, synfig::String& value)const
virtual bool get_raw_value(const synfig::String& key, synfig::String& value)const override
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I renamed to avoid clashes and confusions with the new get_value methods

Comment on lines +346 to +352
set_feather_size(Distance(
settings.get_value("bline.feather", 0.0),
App::distance_system)
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change inherits the bug already present in the released Synfig apps.
It ignores the unit system it was saved - that may different of current App preference...

Another PR should fix it

@rodolforg rodolforg force-pushed the fix-text-tool-widget-vector branch 3 times, most recently from e7b8f8d to 0dd3391 Compare October 21, 2021 03:53
@rodolforg
Copy link
Contributor Author

Rebased

and they include a default_value argument
Let us restrict ChangeLocale usage.

It can cause trouble for mixing current locale.

This commit fixes a problem with Text Tool Options Panel
with size and orientation Widget_Vector showing bizarre values
regarding decimal separator in some non-English locales
(example: Portuguese. Instead of "0,5" it shows "0.50000,00")
@ice0 ice0 merged commit 6bea935 into synfig:master Nov 2, 2021
@ice0
Copy link
Collaborator

ice0 commented Nov 2, 2021

Merged. Thank you!

@rodolforg rodolforg deleted the fix-text-tool-widget-vector branch November 2, 2021 23:34
rodolforg added a commit to rodolforg/synfig that referenced this pull request Nov 20, 2021
They are saved with current preferred unit, but units were ignored when loading.

Many tools ignore the unit system a preference value was saved - that may be different
of current App preference/setting when loaded...
So, for example, 1 pixel can become the gigantic 1u (60px).

Test it:

    In Preferences, assure the Unit System is 'Pixels'
    Select Bline Tool
    In Tool Options Panel, set Brush Size to 1.0 px
    Draw any Bline in Work Area
    Change to Normal Tool
    In Preferences, assure the Unit System is 'Units'
    (optional: close Synfig and reopen it)
    Select Bline Tool again
    Draw another Bline
    It's way thicker than before. If you check Tool Options Panel, you'll see Brush Size as 1.0u

Mentioned first here:
 synfig#2372 (review)
ice0 pushed a commit that referenced this pull request Nov 22, 2021
They are saved with current preferred unit, but units were ignored when loading.

Many tools ignore the unit system a preference value was saved - that may be different
of current App preference/setting when loaded...
So, for example, 1 pixel can become the gigantic 1u (60px).

Test it:

    In Preferences, assure the Unit System is 'Pixels'
    Select Bline Tool
    In Tool Options Panel, set Brush Size to 1.0 px
    Draw any Bline in Work Area
    Change to Normal Tool
    In Preferences, assure the Unit System is 'Units'
    (optional: close Synfig and reopen it)
    Select Bline Tool again
    Draw another Bline
    It's way thicker than before. If you check Tool Options Panel, you'll see Brush Size as 1.0u

Mentioned first here:
 #2372 (review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants