After rotating the text box in the GTK drawing area, the four corners detection doesn’t work anymore as the 4 rectangle vertices are left to their original values. I used this code to update them but still doesn’t work as you can see from the picture. The cursor shape changes when it’s not hovering the top left circle handle.
if(app_data->is_rotating)
{
x1 = app_data->x * cos(app_data->angle* G_PI / 180.0) - app_data->y * sin(app_data->angle* G_PI / 180.0);
y1 = app_data->x * sin(app_data->angle* G_PI / 180.0) + app_data->y * cos(app_data->angle* G_PI / 180.0);
width = app_data->width * cos(app_data->angle* G_PI / 180.0) - app_data->height * sin(app_data->angle* G_PI / 180.0);
height = app_data->width * sin(app_data->angle* G_PI / 180.0) + app_data->height * cos(app_data->angle* G_PI / 180.0);
app_data->x = x1;
app_data->y = y1;
app_data->width = width;
app_data->height = height;
}
Where am I wrong?