Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
Bonzomatic
Commits
fc8c3bdf
Commit
fc8c3bdf
authored
Nov 07, 2019
by
mathieu _alkama_ m
Committed by
Gargaj
Nov 07, 2019
Browse files
Custom scroll speed via config.json (#122)
parent
cc60cf23
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
fc8c3bdf
...
...
@@ -55,6 +55,8 @@ The file can have the following contents: (all fields are optional)
"
tabSize
"
:
8
,
"
visibleWhitespace
"
:
true
,
"
autoIndent
"
:
"
smart
"
,
// can be "none", "preserve" or "smart"
"
scrollXFactor
"
:
1.0
,
// if horizontal scrolling is too slow you can speed it up here (or change direction)
"
scrollYFactor
"
:
1.0
,
// if vertical scrolling is too slow you can speed it up here (or change direction)
},
"
midi
"
:{
// the keys below will become the shader variable names, the values are the CC numbers
"
fMidiKnob
"
:
16
,
// e.g. this would be CC#16, i.e. by default the leftmost knob on a nanoKONTROL 2
...
...
src/Renderer.h
View file @
fc8c3bdf
...
...
@@ -101,8 +101,8 @@ namespace Renderer
struct
MouseEvent
{
MOUSEEVENTTYPE
eventType
;
in
t
x
;
in
t
y
;
floa
t
x
;
floa
t
y
;
MOUSEBUTTON
button
;
};
extern
MouseEvent
mouseEventBuffer
[
512
];
...
...
src/main.cpp
View file @
fc8c3bdf
...
...
@@ -147,6 +147,8 @@ int main(int argc, const char *argv[])
int
nTexPreviewWidth
=
64
;
float
fFFTSmoothingFactor
=
0.9
f
;
// higher value, smoother FFT
float
fFFTSlightSmoothingFactor
=
0.6
f
;
// higher value, smoother FFT
float
fScrollXFactor
=
1.0
f
;
float
fScrollYFactor
=
1.0
f
;
std
::
string
sPostExitCmd
;
...
...
@@ -217,6 +219,10 @@ int main(int argc, const char *argv[])
editorOptions
.
eAutoIndent
=
aitNone
;
}
}
if
(
options
.
get
<
jsonxx
::
Object
>
(
"gui"
).
has
<
jsonxx
::
Number
>
(
"scrollXFactor"
))
fScrollXFactor
=
options
.
get
<
jsonxx
::
Object
>
(
"gui"
).
get
<
jsonxx
::
Number
>
(
"scrollXFactor"
);
if
(
options
.
get
<
jsonxx
::
Object
>
(
"gui"
).
has
<
jsonxx
::
Number
>
(
"scrollYFactor"
))
fScrollYFactor
=
options
.
get
<
jsonxx
::
Object
>
(
"gui"
).
get
<
jsonxx
::
Number
>
(
"scrollYFactor"
);
}
if
(
options
.
has
<
jsonxx
::
Object
>
(
"midi"
))
{
...
...
@@ -351,7 +357,7 @@ int main(int argc, const char *argv[])
mShaderEditor
.
ButtonUp
(
Scintilla
::
Point
(
Renderer
::
mouseEventBuffer
[
i
].
x
,
Renderer
::
mouseEventBuffer
[
i
].
y
),
time
*
1000
,
false
);
break
;
case
Renderer
::
MOUSEEVENTTYPE_SCROLL
:
mShaderEditor
.
WndProc
(
SCI_LINESCROLL
,
-
Renderer
::
mouseEventBuffer
[
i
].
x
,
-
Renderer
::
mouseEventBuffer
[
i
].
y
);
mShaderEditor
.
WndProc
(
SCI_LINESCROLL
,
(
int
)(
-
Renderer
::
mouseEventBuffer
[
i
].
x
*
fScrollXFactor
),
(
int
)(
-
Renderer
::
mouseEventBuffer
[
i
].
y
*
fScrollYFactor
)
);
break
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment