kopia lustrzana https://github.com/corrscope/corrscope
				
				
				
			Merge pull request #201 from nyanpasu64/no-aa
Add antialiasing toggle, disable antialiasing during renderer testspull/357/head
						commit
						2754044cdb
					
				| 
						 | 
				
			
			@ -63,6 +63,8 @@ class RendererConfig(DumpableAttrs, always_dump="*"):
 | 
			
		|||
    v_midline: bool = False
 | 
			
		||||
    h_midline: bool = False
 | 
			
		||||
 | 
			
		||||
    antialiasing: bool = True
 | 
			
		||||
 | 
			
		||||
    # Performance (skipped when recording to video)
 | 
			
		||||
    res_divisor: float = 1.0
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -159,6 +161,10 @@ class MatplotlibRenderer(Renderer):
 | 
			
		|||
    def __init__(self, *args, **kwargs):
 | 
			
		||||
        Renderer.__init__(self, *args, **kwargs)
 | 
			
		||||
 | 
			
		||||
        dict.__setitem__(
 | 
			
		||||
            matplotlib.rcParams, "lines.antialiased", self.cfg.antialiasing
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        # Flat array of nrows*ncols elements, ordered by cfg.rows_first.
 | 
			
		||||
        self._fig: "Figure"
 | 
			
		||||
        self._axes: List["Axes"]  # set by set_layout()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,6 +41,7 @@ def test_default_colors(bg_str, fg_str, grid_str):
 | 
			
		|||
        init_line_color=fg_str,
 | 
			
		||||
        grid_color=grid_str,
 | 
			
		||||
        line_width=2.0,
 | 
			
		||||
        antialiasing=False,
 | 
			
		||||
    )
 | 
			
		||||
    lcfg = LayoutConfig()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -64,6 +65,7 @@ def test_line_colors(bg_str, fg_str, grid_str):
 | 
			
		|||
        init_line_color="#888888",
 | 
			
		||||
        grid_color=grid_str,
 | 
			
		||||
        line_width=2.0,
 | 
			
		||||
        antialiasing=False,
 | 
			
		||||
    )
 | 
			
		||||
    lcfg = LayoutConfig()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue