mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: proper background centering on scaled image
This commit is contained in:
parent
7795d1aaef
commit
ae8d62f5c9
1 changed files with 5 additions and 3 deletions
|
@ -100,9 +100,11 @@ const addContentBackground = (
|
||||||
context.shadowOffsetY = shadow.offsetY * exportScale;
|
context.shadowOffsetY = shadow.offsetY * exportScale;
|
||||||
|
|
||||||
const x =
|
const x =
|
||||||
(normalizedDimensions.width - contentSize.width) / 2 - FANCY_BG_PADDING;
|
(normalizedDimensions.width - contentSize.width * exportScale) / 2 -
|
||||||
|
FANCY_BG_PADDING * exportScale;
|
||||||
const y =
|
const y =
|
||||||
(normalizedDimensions.height - contentSize.height) / 2 - FANCY_BG_PADDING;
|
(normalizedDimensions.height - contentSize.height * exportScale) / 2 -
|
||||||
|
FANCY_BG_PADDING * exportScale;
|
||||||
|
|
||||||
// fixme: position is no scaled to the center
|
// fixme: position is no scaled to the center
|
||||||
if (context.roundRect) {
|
if (context.roundRect) {
|
||||||
|
@ -112,7 +114,7 @@ const addContentBackground = (
|
||||||
(contentSize.width +
|
(contentSize.width +
|
||||||
(DEFAULT_EXPORT_PADDING + FANCY_BG_BORDER_RADIUS) * 2) *
|
(DEFAULT_EXPORT_PADDING + FANCY_BG_BORDER_RADIUS) * 2) *
|
||||||
exportScale,
|
exportScale,
|
||||||
(contentSize.height * exportScale +
|
(contentSize.height +
|
||||||
(DEFAULT_EXPORT_PADDING + FANCY_BG_BORDER_RADIUS) * 2) *
|
(DEFAULT_EXPORT_PADDING + FANCY_BG_BORDER_RADIUS) * 2) *
|
||||||
exportScale,
|
exportScale,
|
||||||
FANCY_BG_BORDER_RADIUS * exportScale,
|
FANCY_BG_BORDER_RADIUS * exportScale,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue