Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
e287e393
Commit
e287e393
authored
Oct 21, 2013
by
mmostajab
Browse files
# Changing from any button to Right mouse button for color detector
parent
16ef3369
Changes
1
Hide whitespace changes
Inline
Side-by-side
application/gui/datacontainerinspectorcanvas.cpp
View file @
e287e393
...
...
@@ -249,19 +249,23 @@ namespace campvis {
e->ignore();
invalidate();*/
tgt
::
ivec2
dimCanvas
=
tgt
::
ivec2
(
_quadSize
.
x
*
_numTiles
.
x
,
_quadSize
.
y
*
_numTiles
.
y
);
if
(
e
->
button
()
==
tgt
::
MouseEvent
::
MOUSE_BUTTON_RIGHT
)
{
if
(
e
->
x
()
>=
dimCanvas
.
x
||
e
->
y
()
>=
dimCanvas
.
y
)
return
;
tgt
::
ivec2
dimCanvas
=
tgt
::
ivec2
(
_quadSize
.
x
*
_numTiles
.
x
,
_quadSize
.
y
*
_numTiles
.
y
);
int
texIndx
=
(
e
->
y
()
/
_quadSize
.
y
)
*
_numTiles
.
x
+
(
e
->
x
()
/
_quadSize
.
x
);
if
(
e
->
x
()
>=
dimCanvas
.
x
||
e
->
y
()
>=
dimCanvas
.
y
)
return
;
int
texIndx
=
(
e
->
y
()
/
_quadSize
.
y
)
*
_numTiles
.
x
+
(
e
->
x
()
/
_quadSize
.
x
);
int
cursorPosX
=
(
float
)(
e
->
x
()
%
_quadSize
.
x
)
/
_quadSize
.
x
*
_textures
[
texIndx
]
->
getWidth
();
int
cursorPosY
=
(
float
)(
e
->
y
()
%
_quadSize
.
y
)
/
_quadSize
.
y
*
_textures
[
texIndx
]
->
getHeight
();
int
cursorPosX
=
(
float
)(
e
->
x
()
%
_quadSize
.
x
)
/
_quadSize
.
x
*
_textures
[
texIndx
]
->
getWidth
();
int
cursorPosY
=
(
float
)(
e
->
y
()
%
_quadSize
.
y
)
/
_quadSize
.
y
*
_textures
[
texIndx
]
->
getHeight
();
_color
=
_textures
[
texIndx
]
->
texelAsFloat
(
cursorPosX
,
cursorPosY
);
_color
=
_textures
[
texIndx
]
->
texelAsFloat
(
cursorPosX
,
cursorPosY
);
_widget
->
updateInfoWidget
();
_widget
->
updateInfoWidget
();
}
}
void
DataContainerInspectorCanvas
::
wheelEvent
(
tgt
::
MouseEvent
*
e
)
{
...
...
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