mirror of
https://codeberg.org/vyivel/dulcepan/
synced 2026-04-26 21:14:40 +03:00
More scale changes :3
Surely this has no bugs in it
This commit is contained in:
+5
-5
@@ -28,7 +28,7 @@ void dp_persistent_load(struct dp_state *state) {
|
||||
}
|
||||
|
||||
char name[32];
|
||||
int x, y, width, height;
|
||||
double x, y, width, height;
|
||||
int n_read = 0;
|
||||
|
||||
fgets(name, sizeof(name), fp);
|
||||
@@ -36,7 +36,7 @@ void dp_persistent_load(struct dp_state *state) {
|
||||
if (name[name_len - 1] == '\n') {
|
||||
name[--name_len] = '\0';
|
||||
}
|
||||
n_read += fscanf(fp, "%d %d %d %d", &x, &y, &width, &height);
|
||||
n_read += fscanf(fp, "%lf %lf %lf %lf", &x, &y, &width, &height);
|
||||
|
||||
bool ok = ferror(fp) == 0 && n_read == 4;
|
||||
fclose(fp);
|
||||
@@ -61,8 +61,8 @@ void dp_persistent_load(struct dp_state *state) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (x < 0 || y < 0 || x + width > selection_output->transformed_width ||
|
||||
y + height > selection_output->transformed_height) {
|
||||
if (x < 0 || y < 0 || x + width > selection_output->effective_width ||
|
||||
y + height > selection_output->effective_height) {
|
||||
dp_log_error("Persistent state: invalid selection geometry", name);
|
||||
return;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ void dp_persistent_save(struct dp_state *state) {
|
||||
} else {
|
||||
fprintf(fp,
|
||||
"%s\n"
|
||||
"%d %d %d %d\n",
|
||||
"%lf %lf %lf %lf\n",
|
||||
selection->output->name, selection->x, selection->y, selection->width,
|
||||
selection->height);
|
||||
fclose(fp);
|
||||
|
||||
Reference in New Issue
Block a user