mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-08 10:07:04 +02:00
Compare commits
2 Commits
v0.9.0
...
fix_canvas
Author | SHA1 | Date | |
---|---|---|---|
![]() |
add75b8c93 | ||
![]() |
0749d2c1f3 |
@@ -1587,17 +1587,21 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event.key === KEYS.G || event.key === KEYS.S) {
|
if (event.key === KEYS.G || event.key === KEYS.S) {
|
||||||
if (this.state.elementType === "selection") {
|
const selectedElements = getSelectedElements(
|
||||||
|
this.scene.getElements(),
|
||||||
|
this.state,
|
||||||
|
);
|
||||||
|
if (
|
||||||
|
this.state.elementType === "selection" &&
|
||||||
|
!selectedElements.length
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
event.key === KEYS.G &&
|
event.key === KEYS.G &&
|
||||||
(hasBackground(this.state.elementType) ||
|
(hasBackground(this.state.elementType) ||
|
||||||
getSelectedElements(
|
selectedElements.some((element) => hasBackground(element.type)))
|
||||||
this.scene.getElements(),
|
|
||||||
this.state,
|
|
||||||
).some((element) => hasBackground(element.type)))
|
|
||||||
) {
|
) {
|
||||||
this.setState({ openPopup: "backgroundColorPicker" });
|
this.setState({ openPopup: "backgroundColorPicker" });
|
||||||
}
|
}
|
||||||
|
@@ -207,6 +207,7 @@ export const renderScene = (
|
|||||||
|
|
||||||
const context = canvas.getContext("2d")!;
|
const context = canvas.getContext("2d")!;
|
||||||
|
|
||||||
|
context.resetTransform();
|
||||||
context.scale(scale, scale);
|
context.scale(scale, scale);
|
||||||
|
|
||||||
// When doing calculations based on canvas width we should used normalized one
|
// When doing calculations based on canvas width we should used normalized one
|
||||||
|
Reference in New Issue
Block a user