Warning, file /graphics/glaxnimate/src/core/model/stretchable_time.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best> 0003 * 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #include "stretchable_time.hpp" 0008 0009 GLAXNIMATE_OBJECT_IMPL(glaxnimate::model::StretchableTime) 0010 0011 bool glaxnimate::model::StretchableTime::validate_stretch(float stretch) 0012 { 0013 return stretch > 0; 0014 } 0015 0016 float glaxnimate::model::StretchableTime::time_to_local(float global) const 0017 { 0018 return (global - start_time.get()) / stretch.get(); 0019 } 0020 0021 float glaxnimate::model::StretchableTime::time_from_local(float local) const 0022 { 0023 return local * stretch.get() + start_time.get(); 0024 } 0025 0026 QString glaxnimate::model::StretchableTime::type_name_human() const 0027 { 0028 return i18n("Timing"); 0029 }