Commit Graph

174 Commits

Author SHA1 Message Date
23rd 90ec66c34c [img-editor] Added simple implementations of blur brush. 2026-04-03 12:59:54 +03:00
23rd 1fa0a8e7ee [img-editor] Removed built-in palette color when width is too small. 2026-04-03 08:25:29 +03:00
23rd f62ae325df [img-editor] Added aspect ratio presets menu to crop tool. 2026-03-31 07:40:24 +03:00
23rd bd6c50c4c2 [img-editor] Dropped saved brush sizes. 2026-03-30 11:01:56 +03:00
John Preston 87ebd2720f Send high quality as first-class option. 2026-03-25 13:08:50 +07:00
23rd f1117b0071 [img-editor] Improved crop overlay with 3x3 grid. 2026-03-16 14:11:52 +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 7d1a7c2b6c [img-editor] Updated color button with rainbow gradient ring. 2026-03-12 12:20:42 +03:00
23rd d581bdcf56 [img-editor] Fixed initial brush stroke on start paint. 2026-03-12 12:59:50 +04:00
23rd cf7ebb0f4a [img-editor] Refined control islands with pill bars. 2026-03-12 12:59:50 +04:00
23rd a242e76f26 [img-editor] Added simple animation to current color on change color. 2026-03-12 12:59:50 +04:00
23rd 380c333185 [img-editor] Added simple animation to size control. 2026-03-12 12:59:50 +04:00
23rd 02eac1ee14 [img-editor] Added ability to save tool size and color separately. 2026-03-12 12:59:49 +04:00
23rd d0d1d91ef3 [img-editor] Added simple highlight of selected tool. 2026-03-12 12:59:49 +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 a5a43dcc7f [img-editor] Added tool buttons in paint mode. 2026-03-12 12:59:49 +04:00
23rd d189b1966e [img-editor] Added simple palette with buttons. 2026-03-12 12:59:49 +04:00
23rd 4b521e687e [img-editor] Removed combined control for size and color. 2026-03-12 12:59:49 +04:00
23rd 6ed80c9706 [img-editor] Added dedicated brush size control. 2026-03-12 12:59:49 +04:00
23rd 898eebbf4b [img-editor] Fixed non-clickable bottom area by masking editor controls. 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 00ef43657e [img-editor] Fixed crash on close by detaching viewport event filter. 2026-03-12 12:59:49 +04:00
23rd 7c5475e62a [img-editor] Added wheel zoom and middle-button pan for paint canvas. 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
John Preston 03df5b8546 rpl::type_erased() -> rpl::type_erased. 2025-12-10 14:27:05 +04: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
John Preston b754ad5248 Use base::weak_qptr / base::make_weak. 2025-07-23 11:40:59 +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
John Preston ded0936bc4 Fix arbitrary aspect in photo editor crop. 2025-02-13 20:20:14 +04:00
John Preston e05bb75b8a Allow sending videos with covers. 2025-02-12 17:24:24 +04:00
23rd ae17acdfd4 Removed include directive for ui_utility from rp_widget header. 2024-08-28 14:38:33 +03:00
23rd 1c223e570a Slightly improved code style for long equality expressions. 2024-04-15 11:20:30 +04:00
23rd d03d50ef0d Removed cIntRetinaFactor and cRetinaFactor. 2024-03-24 07:10:07 +03:00
23rd a1369aaad0 Added references to structured bindings since Apple clang supports them. 2024-01-16 11:18:55 +04:00
23rd baa99be6a5 Removed some unwanted include directives of lang_keys in header files. 2023-11-15 03:30:04 +03:00
23rd e98f56b0b7 Fixed aspect ratio of non-standard stickers in photo editor. 2023-11-06 12:41:15 +04:00
John Preston dd692f2d26 Use simplified TextStyle. 2023-10-13 10:08:29 +04:00
John Preston 2c5d990e1c Implement full theming of attachments in stories. 2023-07-20 07:20:08 +04:00
John Preston 65afa2c402 Detach ComposeControls from SessionController. 2023-05-17 15:51:52 +04:00
John Preston ff4af1b9bc Fix pasting images from Firefox on Windows.
Fixes #10564.

Together with the image data Firefox sets to the clipboard an URLs list
which has a path to local temp file, created from that image.

Reading images from disk is slower + sometimes the content of the file
is wrong so for this case we prefer to read the image data directly.
2023-03-08 16:10:36 +04:00
23rd a7e2de53f5 Moved out size of result file for userpic to public interface. 2023-02-02 22:12:31 +04:00
23rd f077c555e2 Moved out styles of ripples with shadowFg color to single place. 2023-02-02 22:12:31 +04:00
23rd dad9f4b87d Flipped icon for rotation button in photo editor. 2023-01-09 09:05:06 +04:00
John Preston 84288112fc Allow sending photos larger 1280 (experimental).
Improves #6520.
2023-01-02 14:26:41 +04:00
John Preston 17f40d6a1f Don't lose focus when showing image editor. 2022-12-28 13:05:23 +04:00