Skip to content

Transform matrix#633

Open
oneplus1000 wants to merge 2 commits intoApparence-io:masterfrom
oneplus1000:transform_matrix
Open

Transform matrix#633
oneplus1000 wants to merge 2 commits intoApparence-io:masterfrom
oneplus1000:transform_matrix

Conversation

@oneplus1000
Copy link
Copy Markdown

Description

Added transformMatrix to allow custom camera preview adjustments.

New Features

  • Added FuncTransformMatrix: A function that takes PreviewSize and scale, then returns a Matrix4.
  • Added transformMatrix property: Allows users to manually control the preview's transformation.

How it works

  • Default: If transformMatrix is null, the preview uses the standard scaling.
  • Custom: If provided, the library uses your custom function to calculate the matrix.

Motivation

On some devices, the camera preview doesn't align perfectly with the final photo. This change gives users the flexibility to manually fix the preview's position, offset, or scale.

Note on Flutter Analyze

I kept the .scale() method despite the deprecation warning. This is because the master branch still uses it, and I want to keep the code consistent with the current library style.

Checklist

Before creating any Pull Request, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).

  • 📕 I read the Contributing page.
  • 🤝 I match the actual coding style.
  • ✅ I ran flutter analyze without any issues.

Breaking Change

  • 🛠 My feature contain breaking change.

If your feature break something, please detail it

@g-apparence
Copy link
Copy Markdown
Collaborator

This is really cool.
I need to test it a bit more

Love your PR (Sorry I lack of time these days)

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.

2 participants