diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-15 07:44:49 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-15 07:44:49 +0300 |
commit | a308db056515f8fb30be36d6ff028b788626465c (patch) | |
tree | 8ace58b91bebc7fcca27d0d2a09816cb198d05c8 /src/ui/command.c | |
parent | a0ebaca4600d38df843244bda5f54a75d7c59d83 (diff) |
Init and scroll position improvements
Scroll positions are saved as normalized positions so they don’t get affected by zoom differences.
Diffstat (limited to 'src/ui/command.c')
-rw-r--r-- | src/ui/command.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/command.c b/src/ui/command.c index c0828343..19228e46 100644 --- a/src/ui/command.c +++ b/src/ui/command.c | |||
@@ -28,6 +28,15 @@ int arg_Command(const char *cmd) { | |||
28 | return argLabel_Command(cmd, "arg"); | 28 | return argLabel_Command(cmd, "arg"); |
29 | } | 29 | } |
30 | 30 | ||
31 | float argfLabel_Command(const char *cmd, const char *label) { | ||
32 | const iString *tok = tokenString_(label); | ||
33 | const char *ptr = strstr(cmd, cstr_String(tok)); | ||
34 | if (ptr) { | ||
35 | return strtof(ptr + size_String(tok), NULL); | ||
36 | } | ||
37 | return 0.0f; | ||
38 | } | ||
39 | |||
31 | float argf_Command(const char *cmd) { | 40 | float argf_Command(const char *cmd) { |
32 | const char *ptr = strstr(cmd, " arg:"); | 41 | const char *ptr = strstr(cmd, " arg:"); |
33 | if (ptr) { | 42 | if (ptr) { |