-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ff6f76
commit f5f551c
Showing
4 changed files
with
85 additions
and
36 deletions.
There are no files selected for viewing
44 changes: 39 additions & 5 deletions
44
docs/components/guide-examples/display/images/ImageExample.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,55 @@ | ||
"use client" | ||
|
||
import { Coordinates, Image, Mafs } from "mafs" | ||
import { | ||
Coordinates, | ||
Debug, | ||
Image, | ||
Mafs, | ||
useMovablePoint, | ||
} from "mafs" | ||
|
||
import mafs from "./mafs.png" | ||
|
||
export default function VectorExample() { | ||
export default function ImageExample() { | ||
const origin = useMovablePoint([3, 3]) | ||
const padding = 0.1 | ||
|
||
return ( | ||
<Mafs viewBox={{ x: [-1, 7], y: [-1, 5] }}> | ||
<Coordinates.Cartesian /> | ||
<Image | ||
src={mafs.src} | ||
anchor="cc" | ||
x={2} | ||
y={2} | ||
anchor="tl" | ||
x={origin.x + padding} | ||
y={origin.y - padding} | ||
width={2} | ||
height={2} | ||
/> | ||
<Image | ||
src={mafs.src} | ||
anchor="tr" | ||
x={origin.x - padding} | ||
y={origin.y - padding} | ||
width={2} | ||
height={2} | ||
/> | ||
<Image | ||
src={mafs.src} | ||
anchor="bl" | ||
x={origin.x + padding} | ||
y={origin.y + padding} | ||
width={2} | ||
height={2} | ||
/> | ||
<Image | ||
src={mafs.src} | ||
anchor="br" | ||
x={origin.x - padding} | ||
y={origin.y + padding} | ||
width={2} | ||
height={2} | ||
/> | ||
{origin.element} | ||
</Mafs> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters