This website works better with JavaScript.
Home
Help
Sign In
VCVRack
/
Rack
mirror of
https://github.com/VCVRack/Rack.git
Watch
1
Star
0
Fork
0
Code
Issues
0
Releases
43
Wiki
Activity
Browse Source
Use isfinite from C instead of std::isfinite from C++
pull/1639/head
Andrew Belt
7 years ago
parent
fc17785d1d
commit
6dcf3e4b57
3 changed files
with
3 additions
and
3 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
include/util/math.hpp
+1
-1
src/app/Knob.cpp
+1
-1
src/app/SVGKnob.cpp
+ 1
- 1
include/util/math.hpp
View File
@@ -168,7 +168,7 @@ struct Vec {
return x == 0.0f && y == 0.0f;
return x == 0.0f && y == 0.0f;
}
}
bool isFinite() {
bool isFinite() {
return
std::
isfinite(x) &&
std::
isfinite(y);
return isfinite(x) && isfinite(y);
}
}
Vec clamp(Rect bound);
Vec clamp(Rect bound);
};
};
+ 1
- 1
src/app/Knob.cpp
View File
@@ -19,7 +19,7 @@ void Knob::onDragStart(EventDragStart &e) {
void Knob::onDragMove(EventDragMove &e) {
void Knob::onDragMove(EventDragMove &e) {
float range = maxValue - minValue;
float range = maxValue - minValue;
float delta = KNOB_SENSITIVITY * -e.mouseRel.y * speed;
float delta = KNOB_SENSITIVITY * -e.mouseRel.y * speed;
if (
std::
isfinite(range))
if (isfinite(range))
delta *= range;
delta *= range;
// Drag slower if Mod is held
// Drag slower if Mod is held
+ 1
- 1
src/app/SVGKnob.cpp
View File
@@ -24,7 +24,7 @@ void SVGKnob::step() {
if (dirty) {
if (dirty) {
tw->box.size = box.size;
tw->box.size = box.size;
float angle = 0.0;
float angle = 0.0;
if (
std::
isfinite(minValue) &&
std::
isfinite(maxValue))
if (isfinite(minValue) && isfinite(maxValue))
angle = rescale(value, minValue, maxValue, minAngle, maxAngle);
angle = rescale(value, minValue, maxValue, minAngle, maxAngle);
tw->identity();
tw->identity();
// Scale SVG to box
// Scale SVG to box
Write
Preview
Loading…
Cancel
Save