Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
8ca20e35
Commit
8ca20e35
authored
Dec 20, 2011
by
André Reichenbach
Browse files
[FIX] fixed infinite loop in WMHistogramView when adding the module via project file
parent
4d2c93f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/modules/histogramView/WMHistogramView.cpp
src/modules/histogramView/WMHistogramView.cpp
+13
-0
No files found.
src/modules/histogramView/WMHistogramView.cpp
View file @
8ca20e35
...
@@ -271,9 +271,16 @@ void WMHistogramView::moduleMain()
...
@@ -271,9 +271,16 @@ void WMHistogramView::moduleMain()
if
(
m_mainNode
)
if
(
m_mainNode
)
{
{
bool
dataChanged
=
false
;
bool
dataChanged
=
false
;
bool
hasData
=
false
;
for
(
std
::
size_t
k
=
0
;
k
<
m_data
.
size
();
++
k
)
for
(
std
::
size_t
k
=
0
;
k
<
m_data
.
size
();
++
k
)
{
{
dataChanged
=
dataChanged
||
(
m_input
[
k
]
->
getData
()
&&
m_data
[
k
]
!=
m_input
[
k
]
->
getData
()
);
dataChanged
=
dataChanged
||
(
m_input
[
k
]
->
getData
()
&&
m_data
[
k
]
!=
m_input
[
k
]
->
getData
()
);
hasData
=
hasData
||
(
m_input
[
k
]
->
getData
()
||
m_data
[
k
]
);
}
if
(
!
hasData
)
{
continue
;
}
}
bool
colorChanged
=
false
;
bool
colorChanged
=
false
;
...
@@ -344,6 +351,7 @@ void WMHistogramView::moduleMain()
...
@@ -344,6 +351,7 @@ void WMHistogramView::moduleMain()
{
{
m_mainNode
->
remove
(
m_markerNode
);
m_mainNode
->
remove
(
m_markerNode
);
}
}
createInfo
();
createInfo
();
}
}
}
}
...
@@ -857,6 +865,11 @@ void WMHistogramView::createGeometryStairs( int type )
...
@@ -857,6 +865,11 @@ void WMHistogramView::createGeometryStairs( int type )
double
WMHistogramView
::
findOptimalSpacing
(
double
intervalLength
,
double
availableSpace
,
double
textSize
)
double
WMHistogramView
::
findOptimalSpacing
(
double
intervalLength
,
double
availableSpace
,
double
textSize
)
{
{
if
(
intervalLength
<
0.0
)
{
throw
WException
(
"Error in label spacing calculation!"
);
}
// minimum distance of two labels in window coordinates (pixels)
// minimum distance of two labels in window coordinates (pixels)
double
const
minDistance
=
2
*
textSize
;
double
const
minDistance
=
2
*
textSize
;
...
...
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