Commits on Feb 24, 2017
  1. Selection tools: refactor all UI interactions

    This is a necessary step toward migrating individual selection types to
    their own specialized classes (which is a necessary step toward
    supporting multiple selections at once, with various merge operators).
    A number of minor selection bugs and annoyances were also corrected in
    this commit
    committed Feb 24, 2017
Commits on Feb 23, 2017
  1. pdSelection: tie compression settings to appropriate engine

    Selections saved by the Undo/Redo engine now obey the user's Undo/Redo
    compression settings.
    Selections saved by the user now use better (but slower) zstd
    committed Feb 23, 2017
  2. Fix Enter key "ding" in single-line edit boxes

    I thought I'd fixed this, but my Unicode character workaround function
    was accidentally re-inserting the VK_ENTER char back into the character
    queue.  Oops!
    committed Feb 23, 2017
  3. Selection engine overhaul: phase one

    PD's selection engine has been in desperate need of attention for many
    months.  While it works (mostly), the engine's design and structure has
    made it very difficult to improve performance and add new features.
    Among other things, a bunch of its properties are exposed as public
    class variables (seriously, wtf was I thinking), and its integration
    with the main canvas is so fragile that a good portion of pdCanvas's
    mouse handling code exists purely to work around selection tool
    The first step toward fixing these tools was to refactor the code.  The
    pdSelection class now properly encapsulates all of its core
    functionality, and member variables can only be accessed through safe
    wrapper functions.  A bunch of enums and constants have been reworked to
    match other PD coding patterns.  Instead of using parameter strings
    where everything is hard-coded by ordinal position, XML is now used.
    And instead of using a (very fragile) custom file format, saved
    selection data is now handled through pdPackage.  (This is particularly
    relevant during Undo/Redo operations.)
    Given the massive scope of this overhaul, it's entirely possible that
    I've broken some things.  I've done some peripheral testing to make sure
    obvious selection behavior isn't broken, but deeper testing is needed.
    That will happen next, as I start refactoring selection tools to behave
    more like PD's paint engine (where all interactions are nicely
    encapsulated inside their own helper modules and classes, instead of
    polluting the main canvas).
    committed Feb 23, 2017
Commits on Feb 20, 2017
  1. Preliminary rotate cursor support...

    ...vs using the default system "resize" cursor for everything.
    The goal is to eventually migrate all canvas cursors to custom ones,
    which would allow us to custom-scale cursors for users who desire larger
    or smaller ones (or high-contrast ones).  PD doesn't actually use that
    many custom cursors at present, but that's likely to change as more
    features are implemented.
    I'm not pleased with the rotation icon I've got right now, so I'll be
    replacing it before actually activating it.  This however gives me a
    test bed to start working on the problem.
    committed Feb 20, 2017
  2. pdEditBoxW: switch to a much-simpler, non-hook Unicode solution

    This elegant fix was first suggested by @M2000Interpreter in this
    vbforums thread:
    This solution prevents the need to hook keypresses and perform our own
    ToUnicode translation.  Many thanks to George K for this simple and
    effective fix.
    committed Feb 20, 2017
Commits on Feb 19, 2017
Commits on Feb 18, 2017
  1. Typography tool: fix layout on small screens

    Fixes #233 (I hope)
    Many thanks to @leigen for reporting this issue.
    committed Feb 18, 2017
  2. Text tool: fix alignment issue when many text layers are active

    This is actually an unexpected GDI+ bug.  When you request a generic
    typographic string format object from GDI+, it returns some kind of
    *shared* object.  This meant that multiple basic text layers with
    different alignment properties were overwriting each other's formatting
    as they were rendered!
    The solution is to avoid GDI+ shortcut functions entirely, and just
    create our own string format objects from scratch (on a per-layer
    basis).  Or just use the typography tool to avoid this headache
    entirely.  :/
    committed Feb 18, 2017
  3. Text tool: redesign layout

    This fixes one of the problem tools described in #233.
    Next up, doing something similar for typography.
    I realize that this makes PD's text tools even more "panel happy", but
    to produce a big, touch-friendly UI, there's not much getting around it.
    I also like this solution because it frees up room for the future
    possibility of "text entry" settings, e.g. changing the size/font of the
    text entry box (separate from the text layer settings).  I haven't
    settled on a good way to provide this, but it would be helpful for CJK
    languages, as they are particularly hard to read at small sizes.
    committed Feb 18, 2017
  4. pdContainer: raise "size changed" events

    This simplifies a number of layout tasks that are otherwise cumbersome
    committed Feb 18, 2017
Commits on Feb 17, 2017
  1. Brush engine: fix antialiased brush edges sometimes getting...

    ...clipped in the final merge.  Antialiasing efforts may extend up to
    1.0 pixels outside the technical brush area, and we need to account for
    this when calculating merge boundaries.
    committed Feb 17, 2017
  2. More high-DPI improvements

    1) The main window's position and size is now stored as DPI-aware,
    meaning that DPI changes between sessions no longer cause the main
    window to appear at crazy sizes.
    2) Toolbar sizes are also now stored/loaded as DPI-aware, same as (1)
    3) Some status bar icon sizes were wrongly being corrected for DPI
    twice; this has been fixed.
    committed Feb 17, 2017
  3. Effects > Stylize > Palettize: fix Undo behavior

    As a carryover from the old "entire image will be converted to indexed
    color" system, Undo data was incorrectly being flagged as image-level
    instead of layer-level.  This was causing forced rasterization of vector
    layers, which was definitely not wanted.
    committed Feb 17, 2017
  4. Myriad high-DPI fixes

    "Perfect" high-DPI support is still a work in progress, but this makes
    some meaningful strides forward.  Most importantly, this commit finally
    gets bottom tool option panels syncing properly against the main
    window's size, regardless of DPI setting.
    A number of compile-time fixes have also been added, so compiling should
    be (slightly?) faster than before.
    committed Feb 17, 2017
  5. pdThemes: clean up error handling

    Similar to the previous commit, we no longer need to treat missing theme
    files as catastrophic errors (as we can load backups from the exe
    committed Feb 17, 2017
  6. pdResources: centralize error handling

    Also, improve initialization behavior now that we have a proper
    exe-based fallback for missing resource files.
    committed Feb 17, 2017
Commits on Feb 16, 2017
  1. Updated German language file

    Thank you to Roy K for his continued work!
    committed Feb 16, 2017
  2. Add backup theme copies to PD's resource segment

    I went back and forth on whether to do this (as you can see from the
    commit history; sorry about that).  Ultimately, though, I think a tiny
    increase in .exe file size is worth the failsafe ability to pull "known
    good" theme files as necessary.
    All core theme files (including light and dark variations + all accent
    colors) are now stored in PD's resource segment.  In debug builds, PD
    will still preferentially pull theme files from the
    /App/PhotoDemon/Themes folder (which is nice as those files will
    continue to be edited up to release), but if those files go missing or
    this is a production build, PD will instead pull themes from its
    internal resource cache.
    committed Feb 16, 2017
  3. Revert "Revert "pdResources: load default resource collection from th…

    …e .exe itself""
    This reverts commit 6c39cf1.
    committed Feb 16, 2017
  4. Revert "pdResources: load default resource collection from the .exe i…

    This reverts commit 7ab80d5.
    committed Feb 16, 2017
  5. pdResources: load default resource collection from the .exe itself

    In developer builds, the /App/PhotoDemon/Themes folder is still
    preferentially used for resource collections.  (A standalone file is
    much easier to update frequently.)  If that file is missing - or if this
    is a production build - the main resource collection will instead be
    pulled directly from the .exe.
    committed Feb 16, 2017
  6. pdPackager: add "load from memory" option

    Supply a pointer and a length, and the class now handles the rest.
    I've also trimmed memory usage a bit during package loading (from file
    or from memory sources).
    committed Feb 16, 2017
Commits on Feb 15, 2017
  1. Language editor: make improvements to casing behavior

    The automatic translation engine will now try to detect phrases that are
    meant to use titlecase (such as menus or window captions).  When
    auto-translating such text, a successful translation will now be
    "coerced" into proper text whenever possible, which should meaningfully
    improve the quality of automatically generated language files.
    (I've re-translated the Croatian language file from scratch to test the
    new implementation, which is why its diff is so large.  I'll get to
    other auto-translated language files in the coming days)
    committed Feb 15, 2017
  2. On first run, display a language and theme dialog

    After first-run, this dialog can be accessed from the Tools > Theme...
    committed Feb 15, 2017
  3. New Tools > Theme... menu

    All theme settings are now controlled via a single "theme" dialog.  This
    simplifies the UI synchronization process quite a bit, and I wanted to
    build a "language and theme" dialog for first-run purposes anyway, so
    this solved several problems at once.
    Next up is auto-displaying the dialog to users the first time they use
    the program.
    committed Feb 15, 2017
  4. Automatic monochrome icons: make UI support official

    This is now a toggle-able theme setting, just like dark/light themes or
    theme accent color
    committed Feb 15, 2017
  5. New owner-drawn button strip UI element

    I wanted this for the "choose a theme" dialog, as it's easier to display
    accent colors as colors rather than text.  (It also reduces translation
    committed Feb 15, 2017
Commits on Feb 13, 2017
  1. Brush engine: fix coordinate accuracy when greatly zoomed-in

    Different behavior is needed when using our internal paint engine (which
    handles coordinates properly) vs the GDI+ based "quick brush" (which
    requires explicit half-pixel offsets, to ensure that vectors treat the
    "center" of each pixel as its absolute coordinate, rather than the
    top-left corner).
    committed Feb 13, 2017