Skip to content

Commit

Permalink
More due changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gouvernathor committed Feb 11, 2024
1 parent 146403d commit 72a5ae0
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 21 deletions.
7 changes: 2 additions & 5 deletions renpy/atl.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def interpolate_spline(t, spline, typ):
return spline[-1]

if typ in (position, position.from_any) and renpy.config.mixed_position:
typ = position.from_any
spline = [position.from_any(i) for i in spline]

lenspline = len(spline)
Expand Down Expand Up @@ -182,8 +181,6 @@ def interpolate_spline(t, spline, typ):
if rv is None:
return None

if typ is position.from_any:
return position.from_any(rv)
return type(spline[-1])(rv)


Expand Down Expand Up @@ -1446,7 +1443,7 @@ def execute(self, trans, st, state, events):

if radii is not None:
startradius, endradius = radii
trans.state.radius = interpolate(complete, startradius, endradius, position)
trans.state.radius = interpolate(complete, startradius, endradius, position.from_any)

if anchorangles is not None:
startangle, endangle = anchorangles[:2]
Expand All @@ -1456,7 +1453,7 @@ def execute(self, trans, st, state, events):

if anchorradii is not None:
startradius, endradius = anchorradii
trans.state.anchorradius = interpolate(complete, startradius, endradius, position)
trans.state.anchorradius = interpolate(complete, startradius, endradius, position.from_any)



Expand Down
1 change: 1 addition & 0 deletions renpy/display/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@ def get_info():
from . import transform
from . import transition
from . import tts
from . import types
from . import video
from . import viewport
2 changes: 1 addition & 1 deletion renpy/display/displayable.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def place(width, height, sw, sh, placement):
"""

xpos, ypos, xanchor, yanchor, xoffset, yoffset, _subpixel = placement
compute_raw = renpy.types.absolute.compute_raw
compute_raw = renpy.display.types.absolute.compute_raw

if xpos is None:
xpos = 0
Expand Down
5 changes: 2 additions & 3 deletions renpy/display/motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import renpy
from renpy.display.render import render
from renpy.display.layout import Container
from renpy.display.types import absolute, position

# Some imports are here to handle pickles of a moved class.
from renpy.display.transform import Transform, Proxy, TransformState, ATLTransform, null # @UnusedImport
Expand Down Expand Up @@ -211,7 +212,7 @@ def __init__(self, start, end):

def __call__(self, t, sizes=(None, None, None, None)):

return renpy.atl.interpolate(t, tuple(self.start), tuple(self.end), renpy.types.position)
return renpy.atl.interpolate(t, tuple(self.start), tuple(self.end), position.from_any)


def Pan(startpos, endpos, time, child=None, repeat=False, bounce=False,
Expand Down Expand Up @@ -318,8 +319,6 @@ def __init__(self, start, end, child, around=(0.5, 0.5), cor=(0.5, 0.5), pos=Non
self.child = child

def __call__(self, t, rect):
absolute = renpy.types.absolute

(w, h, cw, ch) = rect

# Converts a float to an integer in the given range, passes
Expand Down
5 changes: 1 addition & 4 deletions renpy/display/movetransition.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@


import renpy
from renpy.display.types import absolute

# Utility function used by MoveTransition et al.
def position(d):
Expand Down Expand Up @@ -402,8 +403,6 @@ def child_placement(self, child):
(except subpixel which is boolean)
"""

absolute = renpy.types.absolute

def based(v, base):
if v is None:
return 0
Expand All @@ -429,8 +428,6 @@ def get_placement(self):
if self.time_warp is not None:
done = self.time_warp(done)

absolute = renpy.types.absolute

def I(a, b):
return absolute(a + done * (b - a))

Expand Down
4 changes: 2 additions & 2 deletions renpy/display/particle.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class Sprite(renpy.object.Object):
The methods of a Sprite object are:
"""

x = 0 # type: int|float|renpy.types.absolute
y = 0 # type: int|float|renpy.types.absolute
x = 0 # type: int|float|renpy.display.types.absolute
y = 0 # type: int|float|renpy.display.types.absolute
zorder = 0 # type: int|float


Expand Down
8 changes: 4 additions & 4 deletions renpy/display/render.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ cpdef render(d, object widtho, object heighto, double st, double at):
width, height = d._offer_size

if xmaximum is not None:
width = min(renpy.types.absolute.compute_raw(xmaximum, width), width)
width = min(renpy.display.types.absolute.compute_raw(xmaximum, width), width)

if ymaximum is not None:
height = min(renpy.types.absolute.compute_raw(ymaximum, height), height)
height = min(renpy.display.types.absolute.compute_raw(ymaximum, height), height)

if width < 0:
width = 0
Expand Down Expand Up @@ -857,8 +857,8 @@ cdef class Render:

(xo, yo) = pos

xo = renpy.types.absolute(xo)
yo = renpy.types.absolute(yo)
xo = renpy.display.types.absolute(xo)
yo = renpy.display.types.absolute(yo)

if index is None:
self.children.append((source, xo, yo, focus, main))
Expand Down
4 changes: 2 additions & 2 deletions renpy/text/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ def scale_int(self, n):
if n is None:
return n

if isinstance(n, renpy.types.absolute):
if isinstance(n, renpy.display.types.absolute):
return int(n)

return round(n * self.oversample)
Expand All @@ -966,7 +966,7 @@ def scale_outline(self, n):
if n is None:
return n

if isinstance(n, renpy.types.absolute):
if isinstance(n, renpy.display.types.absolute):
return int(n)

if self.outline_step:
Expand Down

0 comments on commit 72a5ae0

Please sign in to comment.