Bug 345196

Summary: Random animated brush repeats incrementally
Product: [Applications] krita Reporter: Chris Jones <chrjs>
Component: Brush enginesAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: 2.9   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description Chris Jones 2015-03-16 01:24:08 UTC
When creating an animated brush that is set to random, the images appear incrementally.

Reproducible: Always

Steps to Reproduce:
1. Create a 100 x 100 pixel image with 3 layers
2. Draw something different on each layer
3. Go to Edit Brush Settings > Stamp
4. Set the Style to Animated and Selection Mode to Random
5. Draw with the brush and note that the 3 images repeat in succession instead of randomly



This always happens initially, but eventually works properly after wrestling with it for a while.
Comment 1 Halla Rempt 2015-03-19 12:41:59 UTC
Hi Chris,

Yes, it looks like I can confirm the issue.
Comment 2 Halla Rempt 2016-10-09 11:25:34 UTC
Git commit 2c0bc2a25f793b7773af271a5d0695794b0d49d0 by Boudewijn Rempt.
Committed on 09/10/2016 at 11:20.
Pushed by rempt into branch 'master'.

Fix the randomness of KisRandomSource

The root cause probably was all the places where srand was called,
but after this change, textures are random again. This was a problem
on Windows only, probably because the resolution of time() is too
low. But that's a guess.
Related: bug 370246, bug 363663, bug 367873
Closed phabricator task T3887,T3968

M  +22   -5    libs/image/brushengine/kis_random_source.cpp

http://commits.kde.org/krita/2c0bc2a25f793b7773af271a5d0695794b0d49d0