Jump to content

Julius Friedman

  • Posts

  • Joined

  • Last visited


14 Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Right on, I will get you that ASAP but your welcome to deconstruct the pen and I apologize for my expanded style in this regard. Glad we are on the same page!
  2. FYI, this is the pen which has an issue my other pen was working long ago... I only posted it to prove the optimization considering 1000 or more points... And provide an example for the other user(s). https://codepen.io/juliusfriedman/pen/BXgaqO
  3. Yea but one snap should only ever be called per movement right? If I snap I should never call the snap function again? right? I should just be able to rotate the FOV except for the most extreme cases but we are digressing... What custom code is in the snapFunction pen?
  4. The CS is not open source YET, that is something I am cooking up maybe... It shouldn't be in the pen and if you see it let me know but I just checked and I didn't see it... Perhaps cached somehow... Not sure... If the snapFunction runs more than one time there is something wrong no?.... regardless of x or y or xyz, a snap to a single axis across any dimension would technically be acceptable if you need two snaps you should have two separate functions or the function should call that snap function with the information for the axis... I am going on another tangent... :p Let me know what I can do to better assist you with this issue. As you can see in the pen with the snap function I can get to index 3 by my setValue but can you ever drag the handle and get to all index's for both input and change? If so just modify / fork the pen and my apologies. Regards...
  5. Right on, Didn't mean to intrude, just saw your example / demo and thought I could point a few things out so I hoped that helped. Upon noticing an issue in my other example I revised this and wanted to see if it was having an issue I was having and that's how I noticed the edgeResistance, I don't use the edgeResistance either right now so I just wanted to point that out. Indeed it's weird that it happens on this computer which is well equipped yet not with a laptop which is meager in comparison. Yes, the difference is the OS IMHO but the environment is just running GSAP right? It should work in all environments right? I definitely understand your points on the timing issue and I certainly agree there seems to be some funky logic there; especially on my system and the most we can do is document that and try to reliably replicate it so that GSAP can be a better product. My bad if stepped on any toes and what not, just trying to get the bottom of things. Good luck and let me know if theres anything I can do to help!
  6. Just about anything can be done if you put enough time and effort forth... It's called masking or clip-path and you can see a nice little video about it here: Regards
  7. Not sure what you mean, I was editing my post and I got a call and then something else happened I didn't mean to HiJack, I just updated the pen with that users issue. Please take a look at that because I feel it's related and if not in this pen: https://codepen.io/juliusfriedman/pen/NQOaLx On my windows 7 machine there is definitely an issue, onPress is fired and so is onInit but not onClick. And I do apologize for all the editing and confusion, I have a lot going on right now. I am going to take a break again... maybe until tommorow. Hopefully that will give you guys some time to look into this further.
  8. Looking at this just because I am pretty sure the math in my example is correct... https://codepen.io/juliusfriedman/pen/NQOaLx I did some debugging and it seems that only onPressInit and onPress are ever fired again but for some reason there are no listeners attached to the object. a.listeners is empty {} in the minified code. I modified the example to just log on press and click, please see the pen. Verify this put opening up chrome and putting a break point on the `ka = `function which is basically the function which is raising the events. You will verify there that the callback is never executed by stepping the code. After you guys look into this please take a look at my little dragger example and let me know if that's related to this same issue or not. Thank you.
  9. Well the issue started out the same way, all I did was adjust the code to only use the GSAP Draggable and this is what I found... Honestly no, I hadn't; but I just did and the same thing happens. If you would like a screen capture I can provide one. This has nothing to do with my PC as I have another and I just tried the same thing there to make sure I am not going crazy... It's a HP laptop and on that machine it DOES NOT happen. It seems to be resolution / DPI related possibly and the hitTest combined with the edgeResistiance as I previously stated where the loop goes through the client values to offset them for the values in the event. Let me know what I can do to help you guys find the root cause as I am quite sure this has nothing to do with my machine configuration / settings and I would love to be proved wrong. It's also interesting to me because I am also having some positioning issues but when using snaps... Probably not related but who knows. Btw, not to hijack, but if your curious of the issue I was having you can check out https://codepen.io/juliusfriedman/pen/BXgaqO
  10. Yes, in this pen I see the exact same issue as I captured in screen shot. Let me know if you need me to setup a Hangout or something so you can see first hand. The exact URL is https://codepen.io/juliusfriedman/pen/NQOaLx
  11. Obviously you guys have never used ScreenToGif... This has nothing to do with my machine or extensions... I was just trying to show you guys the issue... Here is another screen capture... (slightly too large so I have to link to it) https://giphy.com/gifs/dyingERq65yvQn4Xoc/fullscreen You will see there I reload multiple times and do the same thing quite easily. If i just change the edgeResistance then the problem goes away....
  12. I doubt it as I don't run any extensions and I was just recording the screen with Screen2Gif which shows the clicks for demonstration purposes...
  13. It doesn't it's for demonstration purposes. ScreenToGif does that via an option you can configure.
  14. https://codepen.io/juliusfriedman/pen/NQOaLx I am using Google Chome, 76.0.3809.100 (Official Build) (64-bit) Go that that pen and drag the blue outlined box outside of the rectangle and let go when it's position is outside of the box. It will then snap back to inside the the other box. You can still drag and drop but you won't fire any more press or click events. If you guys need a screen cast I have attached.
  15. Here is a pen @ https://codepen.io/juliusfriedman/pen/BXgaqO This pen contains the improvements I spoke of above. I gave up trying to use the snapIndex which didn't exist and I just tried to do things like were available in the library. (And not because my change didn't work but because I want to show you I am willing to learn if I can) You will see that because of the way the call was bound in the calling script I can't even bind my own context because the wall `call` is used to force the context... The logic to run the snap function specifies the context... `return a.call(Ha,e>c?c+(e-` Thus my snap function will always have the scope of the dragger? Except when called from a dragging event, then the scope is the callbackScope... This means I have to adjust my code to always use call when I am calling the snap function and I would also need the dragger instance to which it was bound... That is slightly awkward as I have given a callback scope and I have bound the function yet surprisingly enough it is called with it's own scope. This means I have to call it from that same scope or determine the scope from the function call... The only problem it seems at this point is that I can't approach the 0 boundary... If you look at the pen and drag the dragger you will see the values in the console, I seem to get the values right for 4, 3, 2 and 1 but the zero boundary is eluding me for some reason right now... In the lower slider there are only values 1 and 0 to make it easier. It seems the snap is working correctly but how to correctly calculate the index is eluding me right now... You will see for the slider with 2 options it works as expected but with 4 options I can't access index 3. The pen is at https://codepen.io/juliusfriedman/pen/BXgaqO and I am taking a break. I am pretty sure that is something with my math though and not your libraries code, specifically @ getSnap where I am probably not understanding how to handle the edge cases... That logic has been extrapolated here for review: function getSnap(endValue) { if (false === Number.isFinite(endValue)) return; const max = this.vars.type === 'x' ? this.vars.bounds.maxX : this.vars.bounds.maxY; if (endValue >= max) return max; const min = this.vars.type === 'x' ? this.vars.bounds.minX : this.vars.bounds.minY; if (endValue <= min) return min; const mean = this.vars.mean; return CS.context.Math.round(endValue / mean) * mean; }; Please do let me know if you see something wrong with that. You can move the slider manually with code like range.setValue(3, true) You will notice that I can get to the correct position that way... However when snapping I can't, I run into values 0, 1, 2 and 4 but never 3 and in other examples there are also holes but not 0 and 1.... I am going to step away for a bit as I can do nothing else outside of rewrite the logic or go back to using snaps like I was at this point. Please do let me know if you see anything as this resolution will relate to how my isTweening questions follow. I just updated the pen to log more and check my math. https://codepen.io/juliusfriedman/pen/BXgaqO I noticed that getSnap is sometimes called just as many if not more times then there are snaps in the array, this depend on the users movement but now I am questioning on if snaps as an array was a better design choice... It seems if the user exceeds the bounds and then comes back in bounds with or without pressing then it can make the issue worse as getSnap may be called more for an unknown reason.... I think this is an issue with the way offset location are being determined to stop the movement when the cursor is outside the bounds but again I only have the minified code to look at. The important things to take away is that I can position the slider handle correctly with the setValue method, yet while I cannot when dragging especially when I perform awkward movements e.g. slow and then fast or circular especially when exceeding the bounds. This is easily replicate-able in the various pens I have so let me know if theres anything that I can do better. I like that the snap function is more efficient but if it's going to be called more times than there are snaps in the sequence then it doesn't make sense for me or I imagine many others... We should only have to snap once and if the value exceeds the bounds at that point then the position is given by the min or max of the corresponding axis... Yes it's a little tricky at the bounds when dragging starts because theres nothing to compare to get a previous position to determine the direction so I think it also has something to do with timing as another user was saying but I am even more so confident that my is right for the application and that the problem lies somewhere in Draggable at this point. One confirmed point is that when the position is at the awkward one and you put a break point, the snap function runs and returns the same value as it did previously however after that breakpoint the element's position can be seen to be changed but the snap function was not called again... Thus I definitely think this is something to do with timing and how the event mechanism for clicks is able to run one more than 1 thread and sometimes that thread has an event which cannot be canceled and thus Draggable thinks that the event was cancelled yet the browser still has av event dispatched in that state. I am quite sure you know all about how events are implemented in browsers so I will leave it at that but if you happen to see something wrong in my code please do punch me in the face Taking the rest of the night to chill as I really don't think there is anything I can do other than go back to using snaps and my hacked up Draggable to save a few cycles which I am hopeful is not the final resolution! Good luck and thank you in advance! Regards!