Skip to content

fix: 이미지(Picture) 회전/대칭 버튼 동작 (#831)#835

Closed
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/picture-rotate-flip
Closed

fix: 이미지(Picture) 회전/대칭 버튼 동작 (#831)#835
oksure wants to merge 2 commits into
edwardkim:develfrom
oksure:contrib/picture-rotate-flip

Conversation

@oksure

@oksure oksure commented May 11, 2026

Copy link
Copy Markdown
Contributor

변경 내용

Closes #831

도구 상자의 회전/대칭 4개 버튼(insert:rotate-cw, insert:rotate-ccw, insert:flip-horz, insert:flip-vert)이 이미지(Picture) 객체에서도 동작하도록 수정합니다.

원인

applyRotationDelta()toggleFlip()에서 ref.type !== 'shape' 가드로 인해 shape 이외의 객체 타입이 모두 차단되었습니다. getProps()/setProps() 헬퍼는 이미 image 경로(getPictureProperties/setPictureProperties)를 지원합니다.

수정

  • ref.type !== 'shape'ref.type === 'equation' || ref.type === 'group'
  • 수식(equation)과 그룹(group)만 제외, image/line 등 허용

테스트

  • cargo test 통과
  • cargo clippy -- -D warnings 경고 없음

감사합니다.

- applyRotationDelta: ref.type !== 'shape' → equation/group만 제외
- toggleFlip: 동일하게 image 타입 허용
- getProps/setProps가 이미 image path를 지원하므로 가드만 완화
Copilot AI review requested due to automatic review settings May 11, 2026 10:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the rotate/flip command handlers in rhwp-studio so that toolbar commands (insert:rotate-cw, insert:rotate-ccw, insert:flip-horz, insert:flip-vert) work for Picture (image) objects, not only shapes, by relaxing the selection-type guard conditions.

Changes:

  • Loosened guards in applyRotationDelta() / toggleFlip() to allow non-shape object types (excluding equation and group).
  • Updated function docstrings to remove the “Shape only” limitation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 383 to 387
const ref = ih.getSelectedPictureRef();
if (!ref || ref.type !== 'shape') return;
if (!ref || ref.type === 'equation' || ref.type === 'group') return;
const props = getProps(services, ref);
const cur = ((props.rotationAngle as number) ?? 0);
let next = cur + delta;
Comment on lines 399 to 403
const ref = ih.getSelectedPictureRef();
if (!ref || ref.type !== 'shape') return;
if (!ref || ref.type === 'equation' || ref.type === 'group') return;
const props = getProps(services, ref);
const cur = !!props[key];
setProps(services, ref, { [key]: !cur });
getProps/setProps가 line 컨트롤에 대해 getPictureProperties를
호출하면 에러 발생. line도 equation/group과 함께 제외.
@oksure

oksure commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

Copilot 리뷰 반영 (95b8e67): line 타입도 제외 (getProps가 getPictureProperties를 호출하여 에러 발생)

@jangster77

Copy link
Copy Markdown
Collaborator

엄청 빠르시네요. 감사합니다.

edwardkim pushed a commit that referenced this pull request May 13, 2026
PR #835 (@oksure) cherry-pick + 메인테이너 보강.

(1) PR #835: applyRotationDelta/toggleFlip 가드를 ref.type !== 'shape'
    → equation/group/line만 제외 (image 허용)로 완화.
(2) 메인테이너 보강: renderPictureObjectSelection에서 image 타입도
    회전각(rotationAngle) 조회 → 선택 BBox가 회전과 함께 표시.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@edwardkim

Copy link
Copy Markdown
Owner

검토 + cherry-pick 머지 완료. 감사합니다.

처리 결과

재검증

  • tsc --noEmit: 에러 0
  • CI: 전부 통과
  • 작업지시자 동작 판정 ★ 통과 (이미지 회전 + BBox 회전 반영)

수고하셨습니다.

@edwardkim edwardkim closed this May 13, 2026
edwardkim pushed a commit that referenced this pull request May 14, 2026
PR #876 (@jangster77) GitHub diff 기반 cherry-pick. mydocs 제외.

insert.ts getProps/setProps에 ref.headerFooter 분기 추가:
- 머리말/꼬리말 picture → get/setHeaderFooterPictureProperties 호출
- PR #832 (Task #825) wasm API 재사용
- applyRotationDelta/toggleFlip 본체 변경 없음

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants