Skip to main content

Docs are still work in progress and lots of information are missing. Join our Discord server to get help.

Contributing to PixiEditor

Hey! Thanks for being interested in the project! It means a lot. This guide will help you get familiar with the codebase.

Before you start

  • Before you start writing code, it's best to discuss the changes you want to make. The quickest way to talk with us is on our discord server. You can also make an issue or comment on an existing one. If you want to work on an issue, keep in mind that some issues can be unexpectedly difficult, and some may even be invalid (since anyone can make one).

  • We welcome early pull requests, in fact, you can and should make one before writing any code. This tells everyone what you are working on, and this way you'll be able to get feedback as you are writing code.

The basics

  • PixiEditor is written in C#, .NET 7
  • We use WPF framework for the UI and SkiaSharp for everything related to drawing/painting.
  • The app has two general parts
    • A GUI built in WPF (with plans to eventually switch to AvaloniaUI or other UI framework)
    • The PixiEditor's Core, the part that implements most of the functionality, like drawing, handling layers, keeping track of the changes for the undo system, etc.

Code main points

PixiEditor project (the GUI)

  • The constructor of MainWindow is considered to be the entry point of program.
  • Part of the initialization also happens in ViewModelMain, which is the DataContext of MainWindow
  • The outside look and layout of PixiEditor's GUI is defined in .xaml files, located in the Views directory
  • The C# code that backs the GUI is mostly located in the ViewModels directory
  • ActionAccumulator is the main class that ties the GUI with the Core.

PixiEditor.ChangeableDocument project (the Core)

  • The Changes directory contains all the code used for actions that change the content of the document, specifically the ones that you can undo and redo. Examples include: Drawing, Creating and deleting layers, Changing canvas size, Selecting pixels with the magic wand tool, etc.