43 lines
1.9 KiB
Python
43 lines
1.9 KiB
Python
|
|
"""Schema 7: an anchor is a peg.
|
||
|
|
|
||
|
|
`[:xform :anchor]` is gone from the transform. `T(a)·M·T(-a)` is a transform
|
||
|
|
conjugated by a translation — "do M in a frame shifted by a" — and a parent
|
||
|
|
already is a shifted frame, so an anchor was a peg written inline: one that could
|
||
|
|
not be selected, keyed, shared between nodes, or placed above a measured channel.
|
||
|
|
A pivot nobody chose is now derived from what the node draws, per drag, and stored
|
||
|
|
nowhere; a pivot to keep is a peg, an ordinary `:group` parent.
|
||
|
|
|
||
|
|
Nothing is converted, as in schema 6. Every project is marked 7, and one that
|
||
|
|
still carries an anchor is refused when it is opened, by name and with what to do
|
||
|
|
about it — `node/problems` in the frontend.
|
||
|
|
|
||
|
|
Not converted rather than not worth converting. Dropping an anchor is in fact
|
||
|
|
pixel-exact wherever rotation and scale are the identity, since the anchor
|
||
|
|
cancels out of the composition there — and that is everywhere a freeze, a drop or
|
||
|
|
a new drawing wrote one. It is NOT exact on anything a hand has since turned or
|
||
|
|
scaled, where the composed translation is `a + p - M·a`, and it cannot be made
|
||
|
|
exact at all where `pos` is dense, because tier 2 is content-addressed and not
|
||
|
|
rewritable here. A conversion would therefore be silent and right for most nodes
|
||
|
|
and silent and wrong for exactly the ones somebody had hand-placed, which is the
|
||
|
|
worse failure: a refusal names the document and says what to do.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from django.db import migrations, models
|
||
|
|
|
||
|
|
|
||
|
|
def forwards(apps, schema_editor):
|
||
|
|
apps.get_model("clips", "Project").objects.update(schema_version=7)
|
||
|
|
|
||
|
|
|
||
|
|
class Migration(migrations.Migration):
|
||
|
|
dependencies = [("clips", "0015_tracing_images")]
|
||
|
|
|
||
|
|
operations = [
|
||
|
|
migrations.AlterField(
|
||
|
|
model_name="project",
|
||
|
|
name="schema_version",
|
||
|
|
field=models.PositiveIntegerField(default=7),
|
||
|
|
),
|
||
|
|
migrations.RunPython(forwards, migrations.RunPython.noop),
|
||
|
|
]
|