From 9877a1211189dd4ffd49a20f6573b19f4e048286 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 12 Mar 2005 06:04:41 +0000 Subject: [PATCH] add scale --- stepmania/Themes/default/Scripts/Utilities.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stepmania/Themes/default/Scripts/Utilities.lua b/stepmania/Themes/default/Scripts/Utilities.lua index 72df0fa42b..3b08290b3b 100644 --- a/stepmania/Themes/default/Scripts/Utilities.lua +++ b/stepmania/Themes/default/Scripts/Utilities.lua @@ -30,6 +30,12 @@ function TableMetricLookup( t, group ) return ret end +-- Scales x so that l1 corresponds to l2 and h1 corresponds to h2. +function scale( x, l1, h1, l2, h2 ) + return (((x) - (l1)) * ((h2) - (l2)) / ((h1) - (l1)) + (l2)) +end + + -- (c) 2005 Glenn Maynard -- All rights reserved. --