Skip to content

Commit

Permalink
fix scaling + bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
anatom3000 committed Oct 22, 2024
1 parent f226cf7 commit 9fa5dc8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# 1.1.0
- Fixed rotation & scaling
- Split UI into smaller submenus
- Added absolute scaling, absolute rotation, use robtop units, use radians, delete original
- Added presets: save and load configurations!
- New button icon

# 1.0.0
- Initial release
Binary file modified functool_popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "Functional",
"description": "An editor tool for placing objects using parameterized formulas",
"description": "Editor tool for placing objects using formulas",
"developer": "anatom3000",
"repository": "https://github.com/anatom3000/Functional",
"id": "anatom3000.functional",
"version": "v1.0.0",
"version": "v1.1.0",
"geode": "3.8.1",
"gd": {
"win": "2.206",
Expand Down
16 changes: 16 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,19 @@ struct matjson::Serialize<ToolConfig> {
.end = "1.0",\
.delete_original = true\
},\
ToolConfig {\
.name = "Random blocks",\
.x = "round(20*random())",\
.y = "round(20*random())",\
.n = "50",\
.start = "0.0",\
.end = "1.0",\
.delete_original = true\
},\
ToolConfig {\
.name = "Modify one",\
.n = "1",\
.start = "0.0",\
.end = "1.0",\
.delete_original = true\
},\
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ class FunctionToolPopup : public geode::Popup<> {

obj_single->addObject(obj);


ui->scaleObjects(obj_single, scale_x*obj->getRScaleX(), scale_y*obj->getRScaleY(), current_center, ObjectScaleType::X, /* absoluteScaling: */ true);
ui->scaleObjects(obj_single, scale_x*obj->getRScaleX(), scale_y*obj->getRScaleY(), current_center, ObjectScaleType::Y, /* absoluteScaling: */ true);
if (!m_abs_scaling) this->scaleRelative(obj, current_center, scale_x, scale_y);
auto base_scale_x = obj->getRScaleX();
auto base_scale_y = obj->getRScaleY();
ui->scaleObjects(obj_single, scale_x*base_scale_x, 1.0, current_center, ObjectScaleType::X, /* absoluteScaling: */ m_abs_scaling);
ui->scaleObjects(obj_single, 1.0, scale_y*base_scale_y, current_center, ObjectScaleType::Y, /* absoluteScaling: */ m_abs_scaling);
if (m_abs_rotation) ui->rotateObjects(obj_single, rotation, obj->getRealPosition());

obj_single->removeLastObject(false);
Expand Down

0 comments on commit 9fa5dc8

Please sign in to comment.