Skip to content

Instantly share code, notes, and snippets.

@Lenkomotive
Last active August 26, 2023 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lenkomotive/98473bd260a05e1372a6daf4410645e9 to your computer and use it in GitHub Desktop.
Save Lenkomotive/98473bd260a05e1372a6daf4410645e9 to your computer and use it in GitHub Desktop.
GSoC 2023 (@International Catrobat Association) final report - Multiline tool with movable intermediate points

GSoC23 Project Summary

I want to enable the linetool to act as a multiline tool with vertices that are changeable, deletable, addable, and saveable. This would allow users to create more complex shapes and diagrams with ease, as they would be able to add and manipulate individual vertices as needed. By making these vertices saveable, users could also revisit and change their work at a later time, making the tool more versatile and useful. Ultimately, the line tool would become a more powerful and adaptable tool for users that need more exact control over their drawings after the addition of these new functionalities.

Goals

Following the determined goals:

  • Spawn vertices between lines
  • Make vertices moveable
  • Add functionality to add and remove vertices
  • Make the entire linesequence editable after an undo-action into a already finalized linesequence
  • Make the linesequence saveable, so opening a catrobat-image containig a linesequence is again adjustable
  • Follow Clean Code Principles
  • Test, test, test,...

Challenges

A primary challenge I encountered during this project was the intricate nature of the existing line tool's codebase. Initially, my objective was to enhance this pre-existing tool. However, upon diving deeper into its structure, I found it riddled with complexities and a myriad of workarounds and many bugs. This revelation led me to pivot: instead of refining what was there, I embarked on designing a completely new tool from the ground up. It took several iterations, particularly in fine-tuning the architecture and data structure, but this fresh start simplified the process immensely. Unlike the previous line tool which relied heavily on member variables and flag-variables to denote its state, the new design harnesses a stack-centric approach. This simplifies code readability greatly.

Current State

The tool has now reached a stage where it is operational and user-ready. We are currently engaged in rigorous testing and refining phases, addressing any lingering bugs. Once this is done, we plan the integration into the production code.

What's left to do

While the tool has made significant progress, the capability to remove vertices is still pending. After thoughtful discussions with my mentors, we've decided to address this feature in a subsequent ticket, post the testing phase. Our immediate focus remains on ensuring a smooth integration of the tool into the production code. Additionally, a forthcoming task will be to retire the legacy line tool and clean up the segments of the codebase it previously influenced

Learnings

During the course of this project, I encountered numerous learning curves, particularly around serialization. Gaining hands-on experience with Kryo offered valuable insights into the intricacies of serialization, teaching me both its challenges and potential. Beyond the technical aspects, the project emphasized the importance of strategic planning. It underscored how crucial it is to design tools in a manner that not only meets immediate requirements but also ensures readability and maintainability for future iterations. This holistic learning experience has fortified my foundation in software development, emphasizing the blend of technical depth with forward-thinking design.

Ticket & PR

Ticket
PR

Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment