Alignment is ignored when using drawTextInRect

I'm using this code to try to draw text aligned to the right:

import("CoreLibs/graphics")

local gfx <const> = playdate.graphics

gfx.drawTextInRect(
  "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",
  20,
  40,
  100,
  1000,
  nil,
  nil,
  -- This is ignored for some reason, it's always left
  gfx.kAlignRight
)

function playdate.update() end

But as you can see on the screenshot, the text is always aligned to the left:

I'm missing something or is this a bug? I'm using SDK v2.7.4 on Windows.

I have been checking this for 30 minutes, and after posting it, I found the solution :upside_down_face:

You need to use kTextAlignment.right:

import("CoreLibs/graphics")

local gfx <const> = playdate.graphics

gfx.drawTextInRect(
  "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",
  20,
  40,
  100,
  1000,
  nil,
  nil,
  -- This works
  kTextAlignment.right
)

function playdate.update() end