Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
BalaSwecha
Density
Commits
5c49f2fb
Commit
5c49f2fb
authored
Oct 29, 2014
by
vikram
Browse files
reseting beaker with water when new object is selected
parent
30548a76
Changes
1
Hide whitespace changes
Inline
Side-by-side
qml/view/DensityWin.qml
View file @
5c49f2fb
...
...
@@ -83,7 +83,7 @@ Item {
anchors.fill
:
parent
onClicked
:
{
if
(
droppedObject
!==
null
&&
droppedObject
.
state
==
"
inBeaker
"
)
{
droppedObject
.
changePosition
(
droppedObject
.
x
,
droppedObject
.
y
+
get
ObjectBottomSinkLevel
(
liquidArea
.
density
)
-
getObjectBottomSinkLevel
(
liqDensity
))
droppedObject
.
changePosition
(
droppedObject
.
x
,
droppedObject
.
y
+
get
LiquidBottomToObjectTopHeight
(
liquidArea
.
density
)
-
getLiquidBottomToObjectTopHeight
(
liqDensity
))
liquidArea
.
density
=
liqDensity
liquidArea
.
type
=
liquidText
.
text
if
(
liquidArea
.
color
!==
color
){
...
...
@@ -162,7 +162,7 @@ Item {
onDropped
:
{
sinks
=
false
droppedObject
=
drag
.
source
droppedObject
.
changePosition
(
droppedObject
.
x
,
droppedObject
.
y
+
(
height
-
drag
.
y
-
get
ObjectBottomSinkLevel
(
liquidArea
.
density
)))
droppedObject
.
changePosition
(
droppedObject
.
x
,
droppedObject
.
y
+
(
height
-
drag
.
y
-
get
LiquidBottomToObjectTopHeight
(
liquidArea
.
density
)))
droppedObject
.
setState
(
"
inBeaker
"
)
resultsGrid
.
addRow
(
droppedObject
.
imgName
,
liquidArea
.
type
,
liquidArea
.
density
,
droppedObject
.
getSinkStatus
(
liquidArea
.
density
))
setImageObject
(
droppedObject
)
...
...
@@ -190,13 +190,15 @@ Item {
function
reset
()
{
showDensityExperiment
(
false
)
liquidArea
.
height
=
liquidLevel
liquidArea
.
color
=
"
#006aff
"
liquidArea
.
opacity
=
0.3
formulaArea
.
reset
()
if
(
droppedObject
!==
null
)
droppedObject
.
opacity
=
0
droppedObject
=
null
}
function
get
ObjectBottomSinkLevel
(
liquidDensity
)
{
function
get
LiquidBottomToObjectTopHeight
(
liquidDensity
)
{
var
objectFloatHt
=
droppedObject
.
height
-
droppedObject
.
getSubMergedHeight
(
liquidDensity
)
if
(
objectFloatHt
<=
0
)
{
return
droppedObject
.
height
...
...
Write
Preview
Supports
Markdown
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