fix reading some elements
This commit is contained in:
parent
4022622de5
commit
6b0d1cd842
@ -338,8 +338,8 @@ class Box(Element):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def read(cls: Type[X], stream: BinaryIO) -> X:
|
def read(cls: Type[X], stream: BinaryIO) -> X:
|
||||||
layer = LAYER.skip_and_read(stream)
|
layer = LAYER.skip_and_read(stream)[0]
|
||||||
dtype = BOXTYPE.read(stream)
|
dtype = BOXTYPE.read(stream)[0]
|
||||||
xy = XY.read(stream).reshape(-1, 2)
|
xy = XY.read(stream).reshape(-1, 2)
|
||||||
properties = read_properties(stream)
|
properties = read_properties(stream)
|
||||||
return cls(layer=(layer, dtype), xy=xy, properties=properties)
|
return cls(layer=(layer, dtype), xy=xy, properties=properties)
|
||||||
@ -372,8 +372,8 @@ class Node(Element):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def read(cls: Type[N], stream: BinaryIO) -> N:
|
def read(cls: Type[N], stream: BinaryIO) -> N:
|
||||||
layer = LAYER.skip_and_read(stream)
|
layer = LAYER.skip_and_read(stream)[0]
|
||||||
dtype = NODETYPE.read(stream)
|
dtype = NODETYPE.read(stream)[0]
|
||||||
xy = XY.read(stream).reshape(-1, 2)
|
xy = XY.read(stream).reshape(-1, 2)
|
||||||
properties = read_properties(stream)
|
properties = read_properties(stream)
|
||||||
return cls(layer=(layer, dtype), xy=xy, properties=properties)
|
return cls(layer=(layer, dtype), xy=xy, properties=properties)
|
||||||
@ -438,8 +438,8 @@ class Text(Element):
|
|||||||
width = 0
|
width = 0
|
||||||
mag = 1
|
mag = 1
|
||||||
angle_deg = 0
|
angle_deg = 0
|
||||||
layer = LAYER.skip_and_read(stream)
|
layer = LAYER.skip_and_read(stream)[0]
|
||||||
dtype = TEXTTYPE.read(stream)
|
dtype = TEXTTYPE.read(stream)[0]
|
||||||
|
|
||||||
size, tag = Record.read_header(stream)
|
size, tag = Record.read_header(stream)
|
||||||
while tag != XY.tag:
|
while tag != XY.tag:
|
||||||
|
Loading…
Reference in New Issue
Block a user