Skip to content

Commit

Permalink
[refactor] use scale ratio directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Mc-Zen committed May 20, 2024
1 parent a9ff09a commit 44e427e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/quantum-circuit.typ
Original file line number Diff line number Diff line change
Expand Up @@ -491,19 +491,16 @@

}) // end circuit = block(..., {

/////////// END Second pass: Generation ///////////
// grace period backwards-compatibility:
let scale = scale
let scale-float = scale / 100%
if circuit-padding != none {
let circuit-padding = process-args.process-padding-arg(circuit-padding)
bounds.at(0) -= circuit-padding.left
bounds.at(1) -= circuit-padding.top
bounds.at(2) += circuit-padding.right
bounds.at(3) += circuit-padding.bottom
}
let final-height = scale-float * (bounds.at(3) - bounds.at(1))
let final-width = scale-float * (bounds.at(2) - bounds.at(0))
let final-height = scale * (bounds.at(3) - bounds.at(1))
let final-width = scale * (bounds.at(2) - bounds.at(0))

let thebaseline = baseline
if type(thebaseline) in ("content", "string") {
Expand All @@ -516,7 +513,7 @@
width: final-width,
height: final-height,
// stroke: 1pt + gray,
align(left + top, move(dy: -scale-float * bounds.at(1), dx: -scale-float * bounds.at(0),
align(left + top, move(dy: -scale * bounds.at(1), dx: -scale * bounds.at(0),
layout.std-scale(
x: scale,
y: scale,
Expand Down

0 comments on commit 44e427e

Please sign in to comment.