From eded2086700f3f238aec730000e867e983f3a5b8 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Fri, 21 Jan 2022 18:41:13 +0000 Subject: [PATCH] [colorLib] remove unused self.slices attribute from LayerListBuilder --- Lib/fontTools/colorLib/builder.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Lib/fontTools/colorLib/builder.py b/Lib/fontTools/colorLib/builder.py index d1d3399bc..3e222e4d0 100644 --- a/Lib/fontTools/colorLib/builder.py +++ b/Lib/fontTools/colorLib/builder.py @@ -444,14 +444,12 @@ def _reuse_ranges(num_layers: int) -> Generator[Tuple[int, int], None, None]: class LayerListBuilder: - slices: List[ot.Paint] layers: List[ot.Paint] reusePool: Mapping[Tuple[Any, ...], int] tuples: Mapping[int, Tuple[Any, ...]] keepAlive: List[ot.Paint] # we need id to remain valid def __init__(self): - self.slices = [] self.layers = [] self.reusePool = {} self.tuples = {} @@ -496,10 +494,6 @@ class LayerListBuilder: # COLR layers is unusual in that it modifies shared state # so we need a callback into an object def _beforeBuildPaintColrLayers(self, dest, source): - paint = ot.Paint() - paint.Format = int(ot.PaintFormat.PaintColrLayers) - self.slices.append(paint) - # Sketchy gymnastics: a sequence input will have dropped it's layers # into NumLayers; get it back if isinstance(source.get("NumLayers", None), collections.abc.Sequence): @@ -557,6 +551,8 @@ class LayerListBuilder: layers = [listToColrLayers(l) for l in layers] + paint = ot.Paint() + paint.Format = int(ot.PaintFormat.PaintColrLayers) paint.NumLayers = len(layers) paint.FirstLayerIndex = len(self.layers) self.layers.extend(layers)