Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@ All notable changes to this project are documented in this file.

This project adheres to Semantic Versioning (`MAJOR.MINOR.PATCH`).

## [1.7.14] - 2026-10-31

### Piece-by-Piece Semantic Drawing Isolation, Timeline Stability Shield & Native Security Engine

This release introduces an authentic whiteboard drawing experience by ensuring every distinct piece and object is drawn 100% completely before moving to the next, fixes timeline scene block shrinkage and playhead desynchronization upon deleting items, hardens project archive security against Zip-Slip attacks, and adds rich interactive visual demonstrations to project documentation.

#### Core Drawing Experience & Whiteboard Engine (تجربة رسم السبورة البيضاء الواقعية)
* **Piece-by-Piece Object Isolation (رسم كل عنصر وتلوينه 100% أولاً):**
- **Solid Reveal Algorithm:** Eliminated unnatural vertical slab slicing where multiple objects on screen were partially filled at the same time. The drawing hand now completes each semantic object (e.g. Laptop, then Arduino, then Arrows, then LEDs) 100% before lifting off the canvas and transitioning to the next item.
- **Clean Outline Algorithm:** Isolated independent vector contours and shapes so that outlines for each object are drawn continuously without erratic jumping back and forth across the canvas. Added smooth in-air flight paths between distinct pieces.
- **Professional CAD Assembly:** Restructured structural CAD rendering so that each mechanical object completes all its assembly phases (outer chassis, primary components, connectors, and fine traces) in sequence before moving to other canvas elements.
- **Organic Sketch Algorithm:** Grouped independent visual clusters to ensure artistic sketches are rendered object by object with natural, continuous hand motions.
- **Natural Hand Velocity:** Fixed excessive hand speed during fill operations, ensuring consistent drawing speeds and natural transitions between visual elements.

#### Timeline & Canvas Stability (استقرار شريط التايم لاين والمشاهد)
* **Scene Duration Shrinkage Elimination:** Fixed an issue where deleting an image or text element caused the scene timeline block to shrink to half a second (0.5s), causing text clipping (`Sc...`). Empty scenes now maintain a clean, stable 2.0-second baseline duration.
* **Automatic Playhead & Timer Resynchronization:** When all items in a scene are deleted, the red playhead line and digital timer automatically return to the start of the scene (`00:00.0 / 00:02.0`) instead of remaining frozen at the end of the deleted media.
* **Timeline Block Drag Constraints:** Enforced a minimum duration of 2.0 seconds when resizing scene blocks directly on the timeline, preventing accidental collapsing of scenes.
* **Preservation of User-Defined Durations:** Manually customized scene durations set via right-click are now preserved even after items are removed or modified.

#### Security & System Protection (محرك الأمان وحماية النظام)
* **Fast In-Memory Protection:** Integrated ultra-fast in-memory validation that prevents application freezing or lag while checking file paths and inputs.
* **Project Archive Shield (Zip-Slip Protection):** Added security safeguards against malicious or corrupted `.dmproj` archives, preventing files from being written outside the project directory.
* **Windows Reserved Name Guard:** Added automatic filtering for reserved Windows system names (`CON`, `PRN`, `AUX`, `NUL`, `COM1-9`, `LPT1-9`) to prevent OS-level deadlocks.

#### Visual Documentation & Demos (التوثيق المرئي والعروض التوضيحية)
* **Live Studio Demonstrations:** Embedded high-resolution animated demonstrations (GIFs) in the project documentation showcasing the full Whiteboard Studio workflow and the natural physics handwriting engine.

---

## [1.7.13] - 2026-10-28

### Robust Playback Crash Shield, Natural Click-Based Text Placement, Transit Hand Isolation & Core Stability
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thank you for your interest in contributing to DrawMotion. We are building an op

---

## Recent Architectural Updates & Solved Issues (v1.7.13)
## Recent Architectural Updates & Solved Issues (v1.7.14)

To help contributors understand the current state of the application and recent developments, here is an overview of the latest bug fixes and functional enhancements:

Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
### The Open-Source Vector Animation & Whiteboard Studio Powered by Python & Qt

[![Microsoft Store](https://img.shields.io/badge/Microsoft%20Store-Available%20Now-0078D4?style=for-the-badge&logo=microsoft-store&logoColor=white)](https://apps.microsoft.com/detail/9NMVGFL73RH4)
[![Latest Release](https://img.shields.io/badge/Release-v1.7.11-2ea44f?style=for-the-badge&logo=github)](https://github.com/DMotionX/DrawMotion/releases)
[![Latest Release](https://img.shields.io/badge/Release-v1.7.14-2ea44f?style=for-the-badge&logo=github)](https://github.com/DMotionX/DrawMotion/releases)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg?style=for-the-badge)](LICENSE)

<br/>
Expand Down Expand Up @@ -41,6 +41,23 @@
<i>DrawMotion Studio running in Ultra-Dark Mode — featuring the dynamic vector canvas, multi-track timeline, audio waveform sync, and precision properties inspector.</i>
</p>

### 🎬 Live Demonstrations & Animation Showcase

<table width="100%">
<tr>
<td width="50%" align="center">
<b>Whiteboard Drawing & Canvas Studio</b><br/>
<i>فيديو توضيحي لاستوديو الرسم والتحريك</i><br/><br/>
<img src="docs/video/فيديو%20توضيحي%20اول.gif" alt="DrawMotion Whiteboard Studio Demo" width="100%" style="border-radius: 8px;" />
</td>
<td width="50%" align="center">
<b>Natural Physics Handwriting Engine</b><br/>
<i>عرض توضيحي لمحرك الكتابة باليد والمحاكاة الحركية</i><br/><br/>
<img src="docs/video/عرض%20توصيحي%20لمحرك%20الكتابة.gif" alt="DrawMotion Handwriting Engine Demo" width="100%" style="border-radius: 8px;" />
</td>
</tr>
</table>

</div>

---
Expand Down
2 changes: 1 addition & 1 deletion build_assets/msstore/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Identity Name="DrawMotion.DrawMotion"
ProcessorArchitecture="x64"
Publisher="CN=5FC00DE5-158E-431A-9660-1C8F36A4FEB0"
Version="1.7.13.0" />
Version="1.7.14.0" />
<Properties>
<DisplayName>DrawMotion</DisplayName>
<PublisherDisplayName>DrawMotion</PublisherDisplayName>
Expand Down
2 changes: 1 addition & 1 deletion build_assets/setup_script.iss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Setup]
SourceDir=..
AppName=DrawMotion
AppVersion=1.7.13
AppVersion=1.7.14
AppPublisher=DrawMotion Team (Mohamed Fadl)
AppPublisherURL=https://github.com/DMotionX/DrawMotion
AppSupportURL=https://drawmotion-web.vercel.app/
Expand Down
2 changes: 1 addition & 1 deletion build_assets/setup_script_github.iss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Setup]
SourceDir=..
AppName=DrawMotion
AppVersion=1.7.13
AppVersion=1.7.14
AppPublisher=DrawMotion Team (Mohamed Fadl)
AppPublisherURL=https://github.com/DMotionX/DrawMotion
AppSupportURL=https://drawmotion-web.vercel.app/
Expand Down
41 changes: 32 additions & 9 deletions components/canvas/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,9 @@ def set_scene_duration_and_scale(self, board, new_dur):
Sets the scene duration and scales all animated items inside it
so their total duration matches the new scene duration.
"""
new_dur = max(2.0, float(new_dur))
board.duration = new_dur
board.user_defined_duration = new_dur

scene_items = [item for item in self.user_items if item.parentItem() == board]
anim_items = [item for item in scene_items if hasattr(item, '_anim_duration')]
Expand Down Expand Up @@ -466,11 +468,21 @@ def calculate_times():
if action['type'] == 'draw' and action['item']:
action['item'].anim_delay = action['start']

if respect_board_duration:
actual_dur = max(0.5, getattr(board, 'duration', total_items_duration))
else:
actual_dur = max(0.5, total_items_duration)
DEFAULT_SCENE_DUR = 2.0
if not anim_items:
# Empty scene (all items removed or fresh): restore/maintain default 2.0s
user_dur = getattr(board, 'user_defined_duration', None)
if user_dur is not None and user_dur >= DEFAULT_SCENE_DUR:
actual_dur = user_dur
else:
actual_dur = DEFAULT_SCENE_DUR
board.duration = actual_dur
else:
if respect_board_duration:
actual_dur = max(DEFAULT_SCENE_DUR, getattr(board, 'duration', total_items_duration))
else:
actual_dur = max(DEFAULT_SCENE_DUR, total_items_duration)
board.duration = actual_dur

new_scene_windows.append({
'scene_index': i,
Expand Down Expand Up @@ -1041,15 +1053,26 @@ def delete_item(self, item):
if item in self.user_items:
self.user_items.remove(item)
self.scene.removeItem(item)
self.animator_engine.hand_item.hide()
self.items_changed.emit(self.user_items)
if hasattr(self, 'animator_engine') and self.animator_engine:
if hasattr(self.animator_engine, 'hand_item') and self.animator_engine.hand_item:
self.animator_engine.hand_item.hide()
if hasattr(self.animator_engine, 'writing_hand_item') and self.animator_engine.writing_hand_item:
self.animator_engine.writing_hand_item.hide()

# If all items are deleted, stop any ongoing playback and reset playhead to 0
if not self.user_items:
if hasattr(self, 'animator_engine') and self.animator_engine:
self.animator_engine.stop()
if hasattr(self, 'animation_progress'):
self.animation_progress.emit(0.0)

# Redistribute time among remaining items
self.distribute_global_time()
self.distribute_global_time(respect_board_duration=False)

# Immediately resync the animator engine queue to match the remaining items
items_to_animate = self.user_items
self.animator_engine.sync_queue(items_to_animate)
items_to_animate = list(self.user_items)
if hasattr(self, 'animator_engine') and self.animator_engine:
self.animator_engine.sync_queue(items_to_animate, force_recompile=True)

self.items_changed.emit(items_to_animate)

Expand Down
20 changes: 17 additions & 3 deletions components/splash/splash_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
import os
import sys
from PySide6.QtCore import Qt, QPropertyAnimation, QEasingCurve, QSize
from PySide6.QtCore import Qt, QPropertyAnimation, QEasingCurve, QSize, QTimer
from PySide6.QtGui import QIcon, QPixmap, QColor
from PySide6.QtWidgets import (
QWidget, QFrame, QVBoxLayout, QHBoxLayout, QLabel,
Expand All @@ -21,7 +21,7 @@ class InteractiveSplashScreen(QWidget):
Studio-grade floating reload and splash screen.
Guarantees instant (<50ms) visual response upon launching DrawMotion.
"""
def __init__(self, version: str = "v1.7.13", parent=None):
def __init__(self, version: str = "v1.7.14", parent=None):
super().__init__(parent)
self.version = version
self._target_window = None
Expand Down Expand Up @@ -180,6 +180,15 @@ def finish_smoothly(self, target_window: QWidget = None) -> None:
except Exception:
pass

# Check if running in headless / offscreen mode (e.g., automated CI test runners)
is_offscreen = (
os.environ.get("QT_QPA_PLATFORM") == "offscreen" or
(QApplication.instance() and getattr(QApplication.instance(), "platformName", lambda: "")() == "offscreen")
)
if is_offscreen:
self._on_fade_finished()
return

# Smooth fade-out animation over the already-rendered target window
self._fade_anim = QPropertyAnimation(self, b"windowOpacity")
self._fade_anim.setDuration(250)
Expand All @@ -191,11 +200,16 @@ def finish_smoothly(self, target_window: QWidget = None) -> None:

def _on_fade_finished(self):
"""Finalizes transition and cleans up splash resources."""
if hasattr(self, "_fade_anim") and self._fade_anim:
try:
self._fade_anim.stop()
except Exception:
pass
if self._target_window is not None:
try:
self._target_window.raise_()
self._target_window.activateWindow()
except Exception:
pass
self.close()
self.deleteLater()
QTimer.singleShot(0, self.deleteLater)
6 changes: 3 additions & 3 deletions components/timeline/layers/scenes_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _populate_track(self):
if t_type and t_type != "None":
t_dur = getattr(prev_board, 'transition_duration', 1.0)
current_time += t_dur
base_dur = getattr(board, 'duration', 8.0)
base_dur = getattr(board, 'duration', 2.0)
items = [i for i in self._workspace.user_items if i.parentItem() == board]

# Find the actual compiled end time for this scene from the scheduler
Expand All @@ -152,9 +152,9 @@ def _populate_track(self):

if items:
# Dynamically stretch the scene duration to fit all items
dur = max(base_dur, max_item_dur)
dur = max(2.0, base_dur, max_item_dur)
else:
dur = base_dur
dur = max(2.0, base_dur)

is_active = (i == self._workspace.current_scene_index) if self._workspace else False
blocks.append({'start': current_time, 'duration': dur,
Expand Down
35 changes: 29 additions & 6 deletions components/timeline/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,18 +346,35 @@ def _on_focus_mode_toggled(self, is_focused):
def set_workspace(self, workspace):
self.workspace = workspace

def compute_total_project_duration(self) -> float:
total_time = 0.0
if self.workspace:
if hasattr(self.workspace, 'artboards') and self.workspace.artboards:
cur_t = 0.0
for i, b in enumerate(self.workspace.artboards):
if cur_t > 0 and i > 0:
prev_b = self.workspace.artboards[i - 1]
t_type = getattr(prev_b, 'transition_type', None)
if t_type and t_type != "None":
cur_t += getattr(prev_b, 'transition_duration', 1.0)
cur_t += getattr(b, 'duration', 2.0)
total_time = cur_t
if hasattr(self.workspace, 'animator_engine'):
schedule = getattr(self.workspace.animator_engine, 'schedule', None)
if schedule:
sched_max = max((a.get('end', 0.0) for a in schedule), default=0.0)
total_time = max(total_time, sched_max)
return max(2.0, total_time)

def set_playhead_progress(self, current_time_sec):
self._last_progress_time = current_time_sec
x_pos = int(current_time_sec * PIXELS_PER_SECOND)
self.playhead_line.move(x_pos, 0)
self.playhead_line.setFixedHeight(self._tracks_container.height())
self.playhead_line.raise_()

# Update Digital Timer
total_time = 0.0
if self.workspace and hasattr(self.workspace, 'animator_engine'):
schedule = self.workspace.animator_engine.schedule
if schedule:
total_time = max(a['end'] for a in schedule)
total_time = self.compute_total_project_duration()

def fmt(t):
m = int(t // 60)
Expand Down Expand Up @@ -414,9 +431,15 @@ def update_timeline(self, items=None):
t_idx = self._tracks_layout.count() - 1
self._tracks_layout.insertWidget(t_idx, row.track_widget())

# Keep playhead on top
# Keep playhead on top and synchronize with project duration
if hasattr(self, 'playhead_line'):
self.playhead_line.raise_()
total_dur = self.compute_total_project_duration()
current_t = getattr(self, '_last_progress_time', 0.0)
if current_t > total_dur:
current_t = 0.0 if not (self.workspace and self.workspace.user_items) else total_dur
self._last_progress_time = current_t
self.set_playhead_progress(current_t)

self._left_layout.invalidate()
self._tracks_layout.invalidate()
Expand Down
4 changes: 2 additions & 2 deletions components/widgets/timeline_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ def mouseMoveEvent(self, event: QMouseEvent):
self.setCursor(Qt.CursorShape.SizeAllCursor) # Cursor for moving
elif getattr(self, '_resizing', False):
dx = event.globalPosition().x() - self._drag_start_x
new_width = max(10, self._original_width + dx)
new_duration = new_width / self.pixels_per_second
min_dur = 2.0 if self.data.get('is_scene_block') else 0.5
new_duration = max(min_dur, (self._original_width + dx) / self.pixels_per_second)
self.duration = new_duration
self._update_width()

Expand Down
Loading
Loading