Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
visimpl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SimVisSuite
visimpl
Commits
01b349ba
Commit
01b349ba
authored
1 year ago
by
Felix de las Pozas
Browse files
Options
Downloads
Patches
Plain Diff
Fix: min/max values changes in TransferFunctionWidget.
parent
ec22cbd7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sumrice/TransferFunctionWidget.cpp
+5
-7
5 additions, 7 deletions
sumrice/TransferFunctionWidget.cpp
sumrice/TransferFunctionWidget.h
+2
-1
2 additions, 1 deletion
sumrice/TransferFunctionWidget.h
with
7 additions
and
8 deletions
sumrice/TransferFunctionWidget.cpp
+
5
−
7
View file @
01b349ba
...
...
@@ -145,8 +145,8 @@ void TransferFunctionWidget::InitDialog( void )
_maxSizeBox
->
setMinimum
(
1.0
);
_maxSizeBox
->
setMaximum
(
300.0
);
connect
(
_minSizeBox
,
SIGNAL
(
valueChanged
(
double
)),
this
,
SLOT
(
onSizeValueChanged
()));
connect
(
_maxSizeBox
,
SIGNAL
(
valueChanged
(
double
)),
this
,
SLOT
(
onSizeValueChanged
()));
connect
(
_minSizeBox
,
SIGNAL
(
valueChanged
(
double
)),
this
,
SLOT
(
onSizeValueChanged
(
double
)));
connect
(
_maxSizeBox
,
SIGNAL
(
valueChanged
(
double
)),
this
,
SLOT
(
onSizeValueChanged
(
double
)));
_minValueLabel
=
new
QLabel
(
);
_maxValueLabel
=
new
QLabel
(
);
...
...
@@ -537,7 +537,7 @@ void TransferFunctionWidget::presetSelected( int presetIdx )
_sizeFrame
->
setGradientStops
(
_nTGradientFrame
->
getGradientStops
(
));
}
void
TransferFunctionWidget
::
onSizeValueChanged
()
void
TransferFunctionWidget
::
onSizeValueChanged
(
double
value
)
{
auto
updateBoxValue
=
[](
QDoubleSpinBox
*
w
,
double
val
)
{
...
...
@@ -551,13 +551,11 @@ void TransferFunctionWidget::onSizeValueChanged()
{
if
(
box
==
_maxSizeBox
)
{
const
auto
minValue
=
_minSizeBox
->
value
();
if
(
box
->
value
()
<
minValue
)
updateBoxValue
(
box
,
minValue
+
0.1
);
updateBoxValue
(
box
,
std
::
max
(
value
,
_minSizeBox
->
value
()));
}
else
{
const
auto
maxValue
=
_maxSizeBox
->
value
();
if
(
box
->
value
()
>
maxValue
)
updateBoxValue
(
box
,
maxValue
-
0.1
);
updateBoxValue
(
box
,
std
::
min
(
value
,
_maxSizeBox
->
value
()));
}
}
}
This diff is collapsed.
Click to expand it.
sumrice/TransferFunctionWidget.h
+
2
−
1
View file @
01b349ba
...
...
@@ -107,9 +107,10 @@ protected slots:
/** \brief Helper method to ensure that min size value is less than
* max size value when updating the values spinboxes.
* \param[in] double value New spinbox value
*
*/
void
onSizeValueChanged
();
void
onSizeValueChanged
(
double
value
);
signals
:
void
colorChanged
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment