Skip to content

Conversation

@SwarnimDoegar
Copy link

No description provided.

@SwarnimDoegar SwarnimDoegar changed the title Support negative values in position x and y for image and text layer Imagekit Editor improvements Jan 20, 2026
@ahnv
Copy link
Member

ahnv commented Jan 22, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7663b96035

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 2941 to +2945
} else if (focus === "coordinates") {
// Handle coordinate-based focus
// x/y are top-left coordinates, xc/yc are center coordinates
if (x) transforms.x = x
if (y) transforms.y = y
if (xc) transforms.xc = xc
if (yc) transforms.yc = yc
if (coordinateMethod === "topleft") {
if (x) transforms.x = x

Choose a reason for hiding this comment

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

P2 Badge Preserve focus coordinates when coordinateMethod is absent

This new gating on coordinateMethod means existing transformations saved before this change (which only stored focus: "coordinates" plus x/y or xc/yc) will no longer emit any coordinates unless coordinateMethod is set. In that case the formatter will silently drop the stored coordinates and the resulting crop will fall back to default positioning. Consider defaulting the branch when coordinateMethod is undefined (e.g., use x/y if present, otherwise xc/yc) to keep backward compatibility. The same pattern appears again in the imageLayer formatter.

Useful? React with 👍 / 👎.

@SwarnimDoegar SwarnimDoegar changed the base branch from main to IK-2461/enhancements January 29, 2026 07:37
@ahnv
Copy link
Member

ahnv commented Jan 29, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e00059e3bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3233 to +3236
if (coordinateMethod === "topleft") {
if (x) transforms.x = x
if (y) transforms.y = y
} else if (coordinateMethod === "center") {

Choose a reason for hiding this comment

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

P2 Badge Preserve coordinate focus when coordinateMethod is absent

This formatter now only emits x/y or xc/yc when coordinateMethod is explicitly set to "topleft" or "center". Any existing transformations loaded via setTransformations that predate this field (i.e., focus=coordinates with x/y or xc/yc but no coordinateMethod) will silently drop their coordinates and produce a different crop. Consider defaulting coordinateMethod in the formatter (e.g., treat missing as topleft or fall back to whichever coordinates are present) to avoid breaking saved configs.

Useful? React with 👍 / 👎.

Comment on lines +2666 to +2670
if (val.focus === "coordinates") {
if (val.coordinateMethod === "topleft") {
if (!val.x && !val.y) {
ctx.addIssue({
code: z.ZodIssueCode.custom,

Choose a reason for hiding this comment

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

P2 Badge Allow zero values in coordinate validation

The new validation treats 0 as falsy, so a valid coordinate like x=0 with y unset fails the “at least one coordinate” check. This blocks users from setting a top/left coordinate at exactly 0. Use explicit null/undefined/empty-string checks instead of !val.x/!val.y (same issue applies to the center coordinate branch below).

Useful? React with 👍 / 👎.

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