Dear all,

I am currently modifying the MacOSX backend to make its 
interactive/non-interactive behavior consistent with the other backends in 
matplotlib.
When I was testing the backend, I found a new bug that seems to be related to a 
recent change in backend_bases.py:

https://github.com/matplotlib/matplotlib/commit/4c078ddf68cc0ecc1a5f36009a3e3a8b4921b037#lib/matplotlib/backend_bases.py

After this commit, GraphicsContextBase.set_alpha has no effect if alpha==None; 
previously it would set alpha to 1.0.

The bug appears here in Text.draw in text.py:

        gc = renderer.new_gc()
        gc.set_foreground(self.get_color())
        gc.set_alpha(self.get_alpha())

In this code, self is a Text object, which derives from the Artist class, which 
initializes its _alpha member to None. So self.get_alpha() returns None, and 
gc.set_alpha has no effect. The alpha value used then depends on whatever was 
present in the gc before the call to new_gc, which is backend-dependent; the 
MacOSX and cairo backends end up with an incorrect alpha value.

I guess the easiest solution is to initialize _alpha in the Artist class to 1.0 
instead of to None.

Thanks,
--Michiel



------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to