Skip to content

Commit

Permalink
SplitSections: Fix bounds calculation for drawings
Browse files Browse the repository at this point in the history
Assf's getBounds computes the actual visible bounding box, but what
we want is the smallest box containing all listed coordinate points.
  • Loading branch information
arch1t3cht committed Jan 16, 2024
1 parent 4e6b933 commit 184298e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions DependencyControl.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@
"changelog": {
"0.1.0": [
"Initial Release. Doesn't account for newlines yet."
],
"0.1.1": [
"Fix bounds calculation for drawings."
]
}
},
Expand Down
6 changes: 3 additions & 3 deletions macros/arch.SplitSections.moon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export script_name = "Split Tag Sections"
export script_description = "Split subtitle lines at tags, creating a separate event for each section"
export script_author = "arch1t3cht"
export script_namespace = "arch.SplitSections"
export script_version = "0.1.0"
export script_version = "0.1.1"

DependencyControl = require "l0.DependencyControl"
dep = DependencyControl{
Expand Down Expand Up @@ -66,8 +66,8 @@ split = (subs, sel) ->
if section.class == ASS.Section.Text
splitLine.width, splitLine.height, splitLine.descent = section\getTextExtents!
else
bounds = section\getBounds!
splitLine.width, splitLine.height, splitLine.descent = bounds.w, bounds.h, 0
ext = section\getExtremePoints!
splitLine.width, splitLine.height, splitLine.descent = ext.w, ext.h, 0

splitLine.x = x

Expand Down

0 comments on commit 184298e

Please sign in to comment.