Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
update: wrap_contentの計算処理の整理
Browse files Browse the repository at this point in the history
  • Loading branch information
PigeonsHouse committed Jan 2, 2024
1 parent 0484bfe commit d1e4b06
Show file tree
Hide file tree
Showing 2 changed files with 231 additions and 155 deletions.
41 changes: 25 additions & 16 deletions src/style/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,36 +480,45 @@ def __repr__(self) -> str:
return str(vars(self))

def get_size_with_padding(self) -> tuple[GraphicValue, GraphicValue]:
width = (
width = self.get_width()
height = self.get_height()
width_with_padding = width + self.padding_left + self.padding_right
height_with_padding = height + self.padding_top + self.padding_bottom
return width_with_padding, height_with_padding

def get_object_length_with_padding(self) -> TimeValue:
object_length = self.get_object_length()
return object_length + self.time_padding_start + self.time_padding_end

def get_object_length(self) -> TimeValue:
return (
self.source_object_length
if (
self.source_object_length is not None
and self.object_length.unit != TimeUnit.FIT
)
else self.object_length
)

def get_width(self) -> GraphicValue:
return (
self.source_width
if (
self.width.unit == GraphicUnit.AUTO
and self.source_width is not None
)
else self.width
)
height = (

def get_height(self) -> GraphicValue:
return (
self.source_height
if (
self.height.unit == GraphicUnit.AUTO
and self.source_height is not None
)
else self.height
)
width_with_padding = width + self.padding_left + self.padding_right
height_with_padding = height + self.padding_top + self.padding_bottom
return width_with_padding, height_with_padding

def get_object_length_with_padding(self) -> TimeValue:
object_length = (
self.source_object_length
if (
self.source_object_length is not None
and self.object_length.unit != TimeUnit.FIT
)
else self.object_length
)
return object_length + self.time_padding_start + self.time_padding_end


def pickup_style(
Expand Down
Loading

0 comments on commit d1e4b06

Please sign in to comment.