The off-axis renderer introduced in #4741 has an issue when the center and the center in rotated frame do not coincide (which happens when it isn't 0.5, 0.5, 0.5 afaik).
In addition, it wraps around the boundaries of the width of the plotting window rather than the simulation domain (if required).
This PR fixes both.
PR Checklist
[ ] Adds a test for any bugs fixed. Adds tests for new features.
Bug reproduction:
import numpy as np
import yt
ds = yt.load_sample("output_00080")
ad = ds.all_data()
center = ds.arr(ad.argmax("density"))
sp = ds.sphere(center, (200, "kpc"))
n = np.array([1, 1, 1.])
n /= np.linalg.norm(n)
p = yt.ProjectionPlot(ds, n, "density", center=center, data_source=sp, width=(400, "kpc"), weight_field=("gas", "density"))
p.set_zlim(("gas", "density"), 1e-4, 5)
p.save("frames/")
PR Summary
The off-axis renderer introduced in #4741 has an issue when the center and the center in rotated frame do not coincide (which happens when it isn't 0.5, 0.5, 0.5 afaik).
In addition, it wraps around the boundaries of the width of the plotting window rather than the simulation domain (if required).
This PR fixes both.
PR Checklist
Bug reproduction: