Skip to content

Commit

Permalink
Merge pull request #214 from dmurdoch/issue213
Browse files Browse the repository at this point in the history
Default selector was wrong in rglMouse().  Fixes #213.
  • Loading branch information
dmurdoch committed Apr 30, 2022
2 parents e224d63 + 7e7b707 commit a0bb49d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,5 +1,5 @@
Package: rgl
Version: 0.108.33
Version: 0.108.34
Title: 3D Visualization Using OpenGL
Authors@R: c(person("Duncan", "Murdoch", role = c("aut", "cre"),
email = "murdoch.duncan@gmail.com"),
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
@@ -1,5 +1,5 @@

# rgl 0.108.33
# rgl 0.108.34

## Major changes

Expand Down Expand Up @@ -83,6 +83,8 @@ objects with user textures.
were not handled properly by `plotmath3d()`.
* Changes introduced in 0.100.50 lacked checks; these caused
segfaults in Windows with R 4.2.0 and RStudio (issue #208).
* `rglMouse()` did not set the default value of the drop-down
selector properly (issue #213).

# rgl 0.108.5

Expand Down
6 changes: 3 additions & 3 deletions R/rglMouse.R
Expand Up @@ -3,11 +3,11 @@ rglMouse <- function(sceneId,
"xAxis", "yAxis", "zAxis",
"polar", "zoom", "fov",
"none"),
labels = choices,
button = 1,
labels = choices,
button = 1,
dev = cur3d(),
subscene = currentSubscene3d(dev),
default = par3d("mouseMode", dev = dev, subscene = subscene)[button],
default = par3d("mouseMode", dev = dev, subscene = subscene)[button + 1],
stayActive = FALSE,
height = 40,
...) {
Expand Down
2 changes: 1 addition & 1 deletion man/rglMouse.Rd
Expand Up @@ -17,7 +17,7 @@ rglMouse(sceneId,
button = 1,
dev = cur3d(),
subscene = currentSubscene3d(dev),
default = par3d("mouseMode", dev = dev, subscene = subscene)[button],
default = par3d("mouseMode", dev = dev, subscene = subscene)[button + 1],
stayActive = FALSE,
height = 40,
...)
Expand Down
3 changes: 2 additions & 1 deletion man/setUserCallbacks.Rd
Expand Up @@ -163,7 +163,7 @@ Duncan Murdoch
pt[0] = x - pt[0];
pt[1] = y - pt[1];
pt[2] = 0;
newdist = this.vlen(pt);
newdist = rglwidgetClass.vlen(pt);
if (newdist < dist) {
dist = newdist;
newclosest = i;
Expand All @@ -182,6 +182,7 @@ Duncan Murdoch
};
window.rglend = function() {
var text = this.getObj(idtext);
closest = -1;
text.colors[0][3] = 0;
text.initialized = false;
this.drawScene();
Expand Down

0 comments on commit a0bb49d

Please sign in to comment.