70 Commits

Author SHA1 Message Date
23rd fdf75eebf3 [img-editor] Restyled popups and sticker panel as mediaview dark theme. 2026-04-23 21:10:16 +03:00
23rd 876117bbf4 [img-editor] Fixed possible crash on exit with text item selected. 2026-04-23 21:09:43 +03:00
23rd 092f81dad6 [img-editor] Added icons for text style options in context menu. 2026-04-23 21:09:43 +03:00
John Preston c0bcdc3829 Fix build with MSVC. 2026-04-20 22:08:24 +07:00
23rd e99442cb1c [img-editor] Fixed contrast text color in edit proxy for framed type. 2026-04-20 12:54:18 +03:00
23rd 085f139abd [img-editor] Clamped text width to prevent negative layout constraints. 2026-04-20 12:54:18 +03:00
23rd f616d19a4e [img-editor] Fixed emoji drawing in text wrapped across line boundaries. 2026-04-20 12:54:18 +03:00
23rd 61cf3a960c [img-editor] Ignored stale deferred text edit callbacks from prior edit. 2026-04-20 12:54:18 +03:00
23rd f94ec5a8a9 [img-editor] Added text editing state flow to keep palette consistent. 2026-04-20 12:54:18 +03:00
23rd a2f228e74d [img-editor] Fixed text selection color sync and isolated from brush. 2026-04-20 12:54:18 +03:00
23rd 3ec1ff8c7e [img-editor] Synced palette color and tool selection with text focus. 2026-04-20 12:54:18 +03:00
23rd 631fe4f362 [img-editor] Improved color handling in text items. 2026-04-20 12:54:18 +03:00
23rd 6153480e43 [img-editor] Fixed text wrapping, spacing, and geometry in editor items. 2026-04-20 12:54:17 +03:00
23rd e1789d40d4 [img-editor] Added auto-fitting width for text editing overlay. 2026-04-20 12:54:17 +03:00
23rd 0fff162c65 [img-editor] Added emoji support in photo editor text items. 2026-04-20 12:54:17 +03:00
23rd 0b70be9a9b [img-editor] Added styled text items. 2026-04-20 12:54:17 +03:00
23rd 90ec66c34c [img-editor] Added simple implementations of blur brush. 2026-04-03 12:59:54 +03:00
23rd 921d5a62d2 [img-editor] Fixed first-stroke jump from invalidated refs.
The interpolation loop kept references to _currentStroke.back()
while pushing into the same vector.
Vector reallocation could invalidate these references
and create random first-segment jumps,
so lastPos/lastPressure are now copied before the loop.

Related commit: d581bdcf56.
2026-03-15 08:05:54 +03:00
23rd 2cce6ddb3e [img-editor] Fixed brush crash by clamping content rect within scene. 2026-03-15 08:05:54 +03:00
23rd d581bdcf56 [img-editor] Fixed initial brush stroke on start paint. 2026-03-12 12:59:50 +04:00
23rd 91df896f8e [img-editor] Refined eraser brush algorithm. 2026-03-12 12:59:49 +04:00
23rd 537375b92b [img-editor] Added simple modes of brush for arrow / marker / eraser. 2026-03-12 12:59:49 +04:00
23rd c4847e752c [img-editor] Expanded paint canvas to fill editor window during zoom. 2026-03-12 12:59:49 +04:00
23rd 8aa09d32dc [img-editor] Fixed brush stroke start offset and spacing at high zoom.
Related commit: 7ce7b88a40.
2026-03-12 12:59:49 +04:00
23rd 6418af0ada Improved division by zero in photo editor stroke rendering calculations. 2025-12-22 17:56:54 +04:00
23rd eca8dfb0ec Renamed rpl::start_with_ with rpl::on_. 2025-12-10 21:28:33 +03:00
23rd 7ce7b88a40 Implemented adaptive drawing algorithm with smoothing in image editor.
- Adaptive point filtering - zoom-based minimum distance (3px / zoom)
  prevents point overflow during fast movements.

- Speed-based pressure simulation - exponential smoothing (decay 0.95)
  creates variable line thickness: pressure = clamp(1.0 - speed * 0.1).

- Two-pass
  weighted averaging - smoothed = current * 0.5 + neighbors * 0.25
  eliminates jagged lines while preserving initial direction.

- Incremental rendering with 3-point overlap - draws only new segments,
  reduces complexity from O(n^2) to O(n).

- QPainterPath with quadratic Bezier curves - single fillPath() call
  instead of multiple drawEllipse().
2025-12-10 09:47:48 +03:00
John Preston 0b67fa65f2 Full upgradable variants preview. 2025-12-05 20:11:54 +04:00
Sean Wei 5a6a5fd4d1 Change const T&& parameters to T&& to enable proper move semantics
Previously some constructors/functions used `const T&&`, which prevents
calling the move constructor. This commit removes the `const` qualifier
so that `std::move` actually performs a move.
2025-06-27 20:50:08 +04:00
23rd d03d50ef0d Removed cIntRetinaFactor and cRetinaFactor. 2024-03-24 07:10:07 +03:00
23rd e98f56b0b7 Fixed aspect ratio of non-standard stickers in photo editor. 2023-11-06 12:41:15 +04:00
John Preston 749fb52113 Implement animated spoilers. 2022-09-18 16:52:30 +04:00
John Preston f8e22210e7 Move Webm sticker to UnwrappedMedia. 2022-08-04 13:35:34 +03:00
John Preston a6621233d0 Show first frame of webm in photo editor. 2022-01-28 19:10:07 +03:00
John Preston 8b7d2c880e Support rendering Webm videos with alpha. 2022-01-28 19:10:07 +03:00
John Preston 3ff17a8789 Refactor image transformation interfaces. 2022-01-21 15:33:44 +03:00
John Preston f1244e19a1 Fix build for Windows. 2022-01-12 13:07:00 +03:00
23rd 39d5d3a1cf Moved some photo editor files to td_ui. 2022-01-12 11:54:25 +03:00
23rd f8be5731a5 Moved out extracting of attached stickers from Scene to FileLoadTask. 2022-01-12 11:54:25 +03:00
John Preston b773bb6e70 Add icons to the media viewer menus. 2021-12-29 21:22:33 +03:00
John Preston 84f561b251 Don't use MTP* in the image editor. 2021-10-04 23:47:33 +04:00
John Preston 19ce1edc16 Use base::SafeRound instead of std::round.
Previous assertion violations because of NaN from std::round were
in video streaming, see commits 27d58ba07b, 8f5830d520.

Now the crashes happened in the ConvertScale() call from a background
thread when preparing an image from clipboard for sending to a chat.
2021-09-27 12:13:57 +04:00
23rd 6b93d8dc41 Refactored and fixed saving scene states between modes in photo editor. 2021-07-09 12:49:07 +03:00
23rd 9be122710d Moved SaveState from Editor::BaseItem to Editor::NumberedItem. 2021-07-09 12:49:07 +03:00
23rd 1e3044fbf4 Moved performing of Undo/Redo from Editor::Paint to Editor::Scene. 2021-07-09 12:49:07 +03:00
23rd aef2148ed0 Moved hasUndo and hasRedo from Editor::Paint to Editor::Scene. 2021-07-09 12:49:07 +03:00
23rd fb511c3e03 Added status to Editor::NumberedItem. 2021-07-09 12:49:07 +03:00
23rd 6acd9f18ad Replaced interaction with QGraphicsItem to Editor::NumberedItem. 2021-07-09 12:49:07 +03:00
23rd 78b25c694e Added ability to save and restore items state in photo editor. 2021-07-09 12:49:07 +03:00
23rd bf8f3e42f4 Simplified work with Editor::ItemBase::Data. 2021-07-09 12:49:07 +03:00