Skip to content

Conversation

@DedeHai
Copy link
Collaborator

@DedeHai DedeHai commented Jan 22, 2026

RotationDemo

Summary by CodeRabbit

  • New Features
    • Added image rotation with adjustable angle settings to the Crop & Adjust Image section
    • Introduced rotation snapping feature for precise angle adjustments
    • Enhanced preview rendering and GIF generation pipeline with full rotation support
    • Increased preview canvas size for improved visibility during editing

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

Walkthrough

Introduces rotation support to the image editing workflow via an offscreen rotation pipeline. New rotation state, UI controls, and rendering paths are added to enable image rotation before cropping and GIF generation, with the preview canvas resized to accommodate the changes.

Changes

Cohort / File(s) Summary
Image Rotation Feature
wled00/data/pixelforge/pixelforge.htm
Added offscreen canvas (rv) and context (rvc) for rotation rendering. New rotation state variable (rot) and update function (rotUpd) integrated into rendering pipeline. All preview, cropping, and GIF frame generation now render through rotated offscreen canvas before final compositing. UI expanded with rotation label, angle display (rotVal), snap checkbox, and slider control (rotSl). Preview canvas size increased from 400 to 500 pixels.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: adding image rotation functionality to the PixelForge GIF tool, which aligns with the substantial modifications to the rotation pipeline, UI controls, and rendering logic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
wled00/data/pixelforge/pixelforge.htm (1)

701-714: Rotation state not reset when loading a new image.

When a new image is loaded, viewReset() resets pan/zoom but doesn't reset the rotation angle. This means if a user rotates one image then loads another, the new image inherits the previous rotation, which is likely unintended.

Suggested fix in viewReset or imgShow
 function viewReset(){
 	bS=Math.min(cv.width/cI.width,cv.height/cI.height);
 	iS=bS;
 	pX=(cv.width-cI.width*iS)/2;
 	pY=(cv.height-cI.height*iS)/2;
+	rot=0;
+	gId('rotSl').value=0;
+	gId('rotVal').textContent='0';
 }

@DedeHai DedeHai changed the title Adding image rotatinon to PixelForge gif tool Adding image rotation to PixelForge gif tool Jan 23, 2026
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.

1 participant