Bug 15782 - (semi-)transparent "grid" elements disappear in the graphics device upon resizing
Summary: (semi-)transparent "grid" elements disappear in the graphics device upon resi...
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Windows GUI / Window specific (show other bugs)
Version: R-devel (trunk)
Hardware: All All
: P5 major
Assignee: Marco Maier
URL:
Depends on:
Blocks:
 
Reported: 2014-04-26 17:39 UTC by Marco Maier
Modified: 2015-05-11 05:40 UTC (History)
2 users (show)

See Also:


Attachments
new window with all 3 lines, only the opaque line remains after resizing the window. (7.48 KB, image/png)
2014-04-26 17:39 UTC, Marco Maier
Details
disappearing semitransparent lines using grid (25.13 KB, image/png)
2015-05-02 09:41 UTC, Marco Maier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Maier 2014-04-26 17:39:51 UTC
Created attachment 1594 [details]
new window with all 3 lines, only the opaque line remains after resizing the window.

if you plot something like

library("grid")
pushViewport(viewport())
grid.segments(.25,.25,.75,.75,gp=gpar(col=gray(0,.25)))
grid.segments(.25,.75,.75,.25,gp=gpar(col=gray(0,.75)))
grid.abline(.5,0)
popViewport()

using the "grid" package, all 3 lines are displayed correctly upon opening a new device - if the graphics window is resized, the transparent elements disappear (see screenshot). line width, etc. do not affect this behavior.
resizing the graphics device works fine under debian and kubuntu, so i guess it's windows-specific.

thx_m
Comment 1 Marco Maier 2015-05-02 09:41:11 UTC
Created attachment 1821 [details]
disappearing semitransparent lines using grid

# this bug is still reproducible in R 3.2.0 and R-devel.
# short code example to show the behavior of base graphics vs. grid.

# setting up colors
y <- seq(0, 255)
w <- abs(seq(-255, 255, length.out = 256)) # transparency
greenred <- rgb(y, 255-y, y*0, alpha = w, maxColorValue = 255)

# lines with alpha < 1 are displayed when resizing a "base graphics" window:
plot(NA, type = "n", xlim = c(0, 255), ylim = c(0, 1))
segments(y, 0, y, 1, col = greenred)

# in "grid", resizing the window causes all alpha < 1 lines to disappear:
dev.new()
library("grid")
pushViewport(viewport(xscale = c(-.1, 1.1), yscale = c(-.1, 1.1)))
grid.segments(y/255, 0, y/255, 1, gp = gpar(col = greenred), default.units = "native")
popViewport()
Comment 2 Paul Murrell 2015-05-04 23:25:39 UTC
This is not reproducible on ...

> R.version
               _                                                 
platform       x86_64-unknown-linux-gnu                          
arch           x86_64                                            
os             linux-gnu                                         
system         x86_64, linux-gnu                                 
status         Under development (unstable)                      
major          3                                                 
minor          2.0                                               
year           2015                                              
month          03                                                
day            11                                                
svn rev        67980                                             
language       R                                                 
version.string R Under development (unstable) (2015-03-11 r67980)
nickname       Unsuffered Consequences
Comment 3 Marco Maier 2015-05-11 05:40:53 UTC
(In reply to Paul Murrell from comment #2)
> This is not reproducible on ...
> 
> > R.version
>                _                                                 
> platform       x86_64-unknown-linux-gnu                          
> arch           x86_64                                            
> os             linux-gnu                                         
> system         x86_64, linux-gnu                                 
> status         Under development (unstable)                      
> major          3                                                 
> minor          2.0                                               
> year           2015                                              
> month          03                                                
> day            11                                                
> svn rev        67980                                             
> language       R                                                 
> version.string R Under development (unstable) (2015-03-11 r67980)
> nickname       Unsuffered Consequences

this problem is windows-specific - debian, kubuntu, etc. work fine (couldn't test it on a mac). just reproduced this on another windows machine:
platform       x86_64-w64-mingw32
arch           x86_64
os             mingw32
system         x86_64, mingw32
status         Patched
major          3
minor          2.0
year           2015
month          05
day            07
svn rev        68343
language       R
version.string R version 3.2.0 Patched (2015-05-07 r68343)
nickname       Full of Ingredients