From a308db056515f8fb30be36d6ff028b788626465c Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 15 Aug 2020 07:44:49 +0300 Subject: Init and scroll position improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scroll positions are saved as normalized positions so they don’t get affected by zoom differences. --- src/ui/command.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ui/command.c') 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) { return argLabel_Command(cmd, "arg"); } +float argfLabel_Command(const char *cmd, const char *label) { + const iString *tok = tokenString_(label); + const char *ptr = strstr(cmd, cstr_String(tok)); + if (ptr) { + return strtof(ptr + size_String(tok), NULL); + } + return 0.0f; +} + float argf_Command(const char *cmd) { const char *ptr = strstr(cmd, " arg:"); if (ptr) { -- cgit v1.2.3