Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colors specified for texts are not respected #34

Open
janssen opened this issue Apr 6, 2016 · 2 comments
Open

colors specified for texts are not respected #34

janssen opened this issue Apr 6, 2016 · 2 comments

Comments

@janssen
Copy link
Contributor

janssen commented Apr 6, 2016

It uses whatever the last Kivy color used was.

@dessant
Copy link
Contributor

dessant commented Apr 6, 2016

Could you share a small example so I can test?

@janssen
Copy link
Contributor Author

janssen commented Apr 6, 2016

Sorry, I don't have a small example. But I have a patch:

*** original/garden.matplotlib/backend_kivy.py  Tue Apr  5 20:23:15 2016
--- fixed/garden.matplotlib/backend_kivy.py Tue Apr  5 19:43:51 2016
***************
*** 650,660 ****
              self.draw_mathtext(gc, x, y, s, prop, angle)
          else:
              font = resource_find(prop.get_name() + ".ttf")
              if font is None:
!                 plot_text = CoreLabel(font_size=prop.get_size_in_points())
              else:
                  plot_text = CoreLabel(font_size=prop.get_size_in_points(),
!                                 font_name=prop.get_name())
              plot_text.text = six.text_type("{}".format(s))
              if prop.get_style() == 'italic':
                  plot_text.italic = True
--- 650,661 ----
              self.draw_mathtext(gc, x, y, s, prop, angle)
          else:
              font = resource_find(prop.get_name() + ".ttf")
+             color = gc.get_rgb()
              if font is None:
!                 plot_text = CoreLabel(font_size=prop.get_size_in_points(), color=color)
              else:
                  plot_text = CoreLabel(font_size=prop.get_size_in_points(),
!                                 font_name=prop.get_name(), color=color)
              plot_text.text = six.text_type("{}".format(s))
              if prop.get_style() == 'italic':
                  plot_text.italic = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants